# Sommige jubileum-badges worden één dag en één jaar na de laatste jubileum-badge toegekend

**URL:** https://meta.discourse.org/t/some-anniversary-badges-are-awarded-one-day-and-one-year-after-the-last-anniversary-badge/325533
**Category:** Bug
**Tags:** badges, pr-welcome
**Created:** [8 september 2024 om 18:52 UTC](https://meta.discourse.org/t/some-anniversary-badges-are-awarded-one-day-and-one-year-after-the-last-anniversary-badge/325533 "2024-09-08T18:52:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![twofoursixeight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twofoursixeight/32/574822_2.png) [@twofoursixeight](https://meta.discourse.org/u/twofoursixeight)
#### Post date: [8 september 2024 om 18:52 UTC](https://meta.discourse.org/t/some-anniversary-badges-are-awarded-one-day-and-one-year-after-the-last-anniversary-badge/325533/1 "2024-09-08T18:52:37Z")

</div>

So a user noticed the behavior of the anniversary badge is strange. It awards the anniversary badge one day one year after the last anniversary badge was awarded. I am not sure if this is intended.

 ![](https://global.discourse-cdn.com/meta/original/4X/f/f/f/fffc8903c13e0c4c712f1d41052cf48373671344.png)

---

<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: [12 september 2024 om 03:51 UTC](https://meta.discourse.org/t/some-anniversary-badges-are-awarded-one-day-and-one-year-after-the-last-anniversary-badge/325533/3 "2024-09-12T03:51:49Z")

</div>

Its a bug, but I think this is one of those ones that is PR welcome, our design is:

1. Once a day we go hunting for new people to give anniversary badges to
2. We only consider people who **did not** get an anniversary badge in the previous 1 year.

Trouble is … this only runs once a day at an arbitrary time, this means the job always runs late, sometimes 1 hour late, some times 23 hours late.

Given we are only granting badges once a day we would need to change our logic to:

1. Fish for candidates
2. set the `created_at:` at the correct offset instead of using `end_date`

> <https://github.com/discourse/discourse/blob/1f1709d249cf282baf532b7dd6c599d0e9c88b6a/app/jobs/scheduled/grant_anniversary_badges.rb#L14-L19>

Not an impossible fix by any means, but fiddly.

---

<div class="post-metadata">

### Author: ![magni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/magni/32/105333_2.png) [@magni](https://meta.discourse.org/u/magni)
#### Post date: [20 september 2024 om 02:31 UTC](https://meta.discourse.org/t/some-anniversary-badges-are-awarded-one-day-and-one-year-after-the-last-anniversary-badge/325533/4 "2024-09-20T02:31:13Z")

</div>

I’ve opened a PR (my first!) for this here: [FIX: Ensure subsequent Anniversary badges are granted on a user's anniversary date by magni- · Pull Request #28979 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/28979)
