fix(matchmaker): use inclusive boundary for classic promotion age check

90 days == 3 calendar months exactly in March/April, causing
TestThreeMonthAgeCheck to fail. The intent is >= 3 months old.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-23 17:45:36 -04:00
parent 283e0df5e5
commit 002f945298
2 changed files with 2 additions and 2 deletions

View file

@ -257,7 +257,7 @@ func (m *Matchmaker) promoteClassicMaps(ctx context.Context) error {
WHERE player_count = $1
AND status = 'active'
AND engagement > 0
AND created_at < NOW() - INTERVAL '3 months'
AND created_at <= NOW() - INTERVAL '3 months'
ORDER BY engagement DESC
LIMIT $2
) sub

View file

@ -269,7 +269,7 @@ func TestThreeMonthAgeCheck(t *testing.T) {
createdAt := now.Add(-tc.createdAgo)
// Use a simpler check: created_at < NOW() - 3 months
cutoff := now.AddDate(0, -classicMinMonths, 0)
eligibleByDate := createdAt.Before(cutoff)
eligibleByDate := !createdAt.After(cutoff)
if eligibleByDate != tc.eligible {
t.Errorf("created %v ago: eligible=%v, want %v", tc.createdAgo, eligibleByDate, tc.eligible)
}