# Erstes Zitat-Abzeichen nach einem Monat verliehen

**URL:** <https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269>\
**Category:** Bug\
**Tags:** badges\
**Created:** [2. April 2019 um 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:** 1\
**Showing post:** 12

<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:** [3. April 2019 um 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.

---

_[View the full topic](https://meta.discourse.org/t/first-quote-badge-awarded-after-a-month/113269)._
