"Great Reply" granted date is actually the date of the post

AI-generated summary

A user, seanblue, reported a bug on the Discourse forum regarding the “Great Reply” badge. They noticed that the badge’s “grant date” was set to the post’s creation date, even if the 50th like was received later. simon explained that this is due to the badge query using the post’s updated_at column, which is not reset when a post is liked. simon suggested using current_timestamp to set the granted_at time, similar to other daily badge queries. sam agreed to make the change, which will ensure that the “grant date” is set correctly going forward, although historical dates will not be fixed. The change was implemented in a GitHub commit.

On https://community.wanikani.com/ I got a notification that someone liked my post, following by a “great reply” notification. This like was indeed the 50th like for that post. However, it says I earned the “great reply” badge 5 days ago. I’ve seen this happen at least one time before.

I made this post 5 days ago, but I would think the badge “grant date” should be based on… well, when it was granted, which is why I put this under Contribute > Bug. If this is intended, just let me know.

6 Likes

The Great Reply badge query is using the post’s updated_at column to set when the badge was granted. Liking a post does not reset its updated_at value, so granted at will be set to the post’s creation date, or to the last time the post was edited.

We have a few other queries that are triggered when a user acts on a post that set the granted at time in the same way. For badges where the query is run once daily, for example the Famous Link badge, current_timestamp is used to set granted_at. Could a similar approach be used for queries that are triggered when a user acts on a post?

8 Likes

Sure this is a simple enough change. Date will not be fixed historically but going forward it should be a little bit saner.

https://github.com/discourse/discourse/commit/58d6ee36ee460e2f7f5da0121dcbaa7929b7d7d5

6 Likes