가입일보다 앞서 '이달의 신규 사용자' 배지가 수여됨

Hello all!

I’ve just noticed that two of my users got the New user of the month badge before their actual registration date. That shouldn’t be possible should it?


I currently have two members that have been granted this badge before registration date.

4개의 좋아요

I think there’s a problem with the logic that’s being used here:

It’s checking stats for any users who were created after the beginning of the previous month. So if a user joined in mid June, it will be checking stats from the beginning of May up until mid June. The badge is then has its created_at date set to the end of the previous month (May 31). This would allow a user who was created in June to have their New User of the Month badge awarded at the end of May.

10개의 좋아요

Nice repro @simon!

This fixes it:

https://github.com/discourse/discourse/commit/a73da42691734d8afddb4a255969c934da6d4ad9

8개의 좋아요