# 首枚引用徽章在一个月后颁发

**URL:** <https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269>\
**Category:** Bug\
**Tags:** badges\
**Created:** [2019年四月2日 21:26 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269 "2019-04-02T21:26:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![thegurjyot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thegurjyot/32/120516_2.png) [@thegurjyot](https://meta.discourse.org/u/thegurjyot)\
**Post date:** [2019年四月2日 21:26 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/1 "2019-04-02T21:26:40Z")

</div>

Today I was awarded First Quote badge for a post which I wrote more than a month ago. Is there’s some issue with timings of the badge? See the badge awarded

 ![badge](https://global.discourse-cdn.com/meta/original/3X/9/a/9a0544c2dda6732144e3c4b8a89325666a295259.png)

Now see the date of the post for which this badge is awarded

 ![badge1](https://global.discourse-cdn.com/meta/original/3X/2/b/2b6244cda31afb86c19c8197c5467bbbde78ab6a.png)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年四月2日 21:50 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/2 "2019-04-02T21:50:27Z")

</div>

Can you test this on try and see if it works as expected @tshenry?

---

<div class="post-metadata">

**Author:** ![jtbayly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jtbayly/32/119510_2.png) [@jtbayly](https://meta.discourse.org/u/jtbayly)\
**Post date:** [2019年四月2日 21:55 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/3 "2019-04-02T21:55:16Z")

</div>

I just earned the badge on this site for a post from 6 days ago. And I’m virtually certain it’s not my first quote here.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年四月2日 21:59 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/4 "2019-04-02T21:59:01Z")

</div>

Can you think of any reason this would have regressed @sam?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年四月2日 22:06 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/5 "2019-04-02T22:06:54Z")

</div>

Maybe the bug @david talked about where our scheduler was clogged that @tgxworld fixed?

---

<div class="post-metadata">

**Author:** ![rkaplan](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@rkaplan](https://meta.discourse.org/u/rkaplan)\
**Post date:** [2019年四月2日 22:07 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/6 "2019-04-02T22:07:59Z")

</div>

I got both First Quote and First Emoji today - but they apply to prior dates.

---

<div class="post-metadata">

**Author:** ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)\
**Post date:** [2019年四月2日 22:23 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/7 "2019-04-02T22:23:10Z")

</div>

I was awarded the Wiki Editor and First Quote badge today as well, although they were completed prior.

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [2019年四月2日 23:04 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/8 "2019-04-02T23:04:06Z")

</div>

On try, I received the First Quote badge/notification about 5 seconds after posting my first quote, so working as expected there.

---

<div class="post-metadata">

**Author:** ![Genyus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/genyus/32/119655_2.png) [@Genyus](https://meta.discourse.org/u/Genyus)\
**Post date:** [2019年四月2日 23:52 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/9 "2019-04-02T23:52:21Z")

</div>

Not that it’s a particularly big deal, but I got awarded First Quote for a post I made back in August last year. 🙃

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年四月3日 02:12 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/10 "2019-04-03T02:12:25Z")

</div>

Yeah these issues are specific to meta per @sam and @tgxworld

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年四月3日 02:14 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/11 "2019-04-03T02:14:16Z")

</div>

Technically this is a long standing bug in mini\_scheduler but the queue starvation problem only got exposed on specific sites where we enabled a problem schedule.

We will get this properly sorted soon.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年四月3日 05:43 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/12 "2019-04-03T05:43:18Z")

</div>

Hmmm…

Looks like the quoted post was created here:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/0/60bc6b230f11698d68432019dc70e3bbafa07eea.png)

So looks like the scheduler is all right, the record was created just recently.

This post was rebaked a few days ago.

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/e/eecd944975c52d1ae788750bf78afadc6a1e14fb.png)

So somehow the `quoted_post` record only got created then.

I went ahead and fixed quoted\_post so we stop destroying the record each time a rebake happens per this somewhat tricky commit:

> <https://github.com/discourse/discourse/commit/b2dc65f9534ea041818b9b968f60959b4f707705>
>
> Previously every rebake would remove and recreate records in this table
> This cau…sed created\_at and updated\_at to keep changing
> 
> Yes, I know the SQL is somewhat complex, but this makes quote extraction
> more efficient cause we do everything in 2 round trips.
> 
> This also removes some concurrency protection we should no longer need

I also picked a slightly better poison for the “grant date” we grant the badge at the date the post was originally created which may be different to the data a quote was inserted.

> <https://github.com/discourse/discourse/commit/1c57ae66571f99ce3249d798188c5234e4a78e93>
>
> Previously due to #b2dc65f9534ea date on the quoted\_posts table could not
> be tru…sted.
> 
> This changes it so we use the date on the actual post as the grant date.
> 
> Note: there is an edge case where you create a post and only add a quote
> a week later. In this case the badge will not be awarded at the correct
> time (it will display it was granted a week ago).
> That said this is far more rare than the current situation.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年四月6日 07:12 UTC](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269/13 "2019-04-06T07:12:06Z")

</div>

This topic was automatically closed after 3 days. New replies are no longer allowed.
