claude/discord-ping-notification-filter-6m1ymt #120

Merged
chrisp merged 2 commits from claude/discord-ping-notification-filter-6m1ymt into main 2026-06-30 23:48:12 +00:00

2 commits

Author SHA1 Message Date
Claude
613106cb9e
Fix notification filter: only include matches where an owner earned points or lost
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m56s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m18s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
The previous filter let matches through if showLoser was true (loser got a
finalized result) regardless of whether the loser or winner was actually
owned by a manager. This caused spurious notifications when a managed team
advanced through a non-scoring round (e.g. R32 → R16 in World Cup) while
beating an unowned opponent who happened to get a 0-pt finalized result.

New rule: a match is worth announcing only when the winner is owned AND
earned points, OR the loser is owned. When a match fires because the loser
is owned, the winner's manager tag is still shown for context but they are
not Discord-pinged (winnerDiscordUserId remains gated on winnerScoreChanged).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UXKpR3MZJn5Zof1AKeETFM
2026-06-30 23:40:41 +00:00
Claude
177555f043
Fix Discord notification firing for advancing-only World Cup teams
In non-scoring rounds (R32 → R16 in FIFA 48), winners advance without
earning any points. The previous code set winnerUsername unconditionally
for any match where the winner had an owner, so when a loser was
eliminated (triggering showLoser=true), the advancing winner appeared in
the "Scored Matches" section and triggered a notification even though
their fantasy score was unchanged.

Gate winnerUsername on winnerScoreChanged, matching the existing guard
on winnerDiscordUserId. A manager is now only mentioned when their team
actually earned or changed points this round.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UXKpR3MZJn5Zof1AKeETFM
2026-06-30 23:31:36 +00:00