Fix complete-round redundant Discord/recalculation and stale comment

complete-round was calling processPlayoffEvent without skipRecalculate,
firing recalculateAffectedLeagues and Discord even though each match
winner had already triggered those side effects via set-winner. Add
skipRecalculate: true to match the autoCompleteRoundIfDone pattern.

Also fix autoCompleteRoundIfDone comment which incorrectly said
"non-bracket eliminations are recorded" — that's a separate step in
finalize-bracket; processPlayoffEvent records bracket round placements.

https://claude.ai/code/session_01RhQS6FQRh6iYtVNaryCEf5
This commit is contained in:
Claude 2026-04-05 22:04:16 +00:00
parent 3981fe37ab
commit fbec11d171
No known key found for this signature in database

View file

@ -212,7 +212,7 @@ export async function action({ request, params }: Route.ActionArgs) {
/** /**
* Auto-complete a round when every match in it is marked complete. * Auto-complete a round when every match in it is marked complete.
* Updates scoringEvents.playoffRound and calls processPlayoffEvent so that * Updates scoringEvents.playoffRound and calls processPlayoffEvent so that
* non-bracket eliminations are recorded and probabilities are refreshed. * round placements are recorded and probabilities are refreshed.
* This replaces the manual "Complete Round" button. * This replaces the manual "Complete Round" button.
* *
* skipRecalculate=true because the caller already sent a Discord notification * skipRecalculate=true because the caller already sent a Discord notification
@ -552,8 +552,10 @@ export async function action({ request, params }: Route.ActionArgs) {
}; };
} }
// Process playoff event to update participant results // Process playoff event to update participant results.
await processPlayoffEvent(params.eventId); // skipRecalculate=true: match winners were already set via set-winner/set-round-winners,
// which triggered recalculateAffectedLeagues and Discord per match. No need to re-fire.
await processPlayoffEvent(params.eventId, undefined, { skipRecalculate: true });
return { return {
success: `${round} completed and placements calculated successfully`, success: `${round} completed and placements calculated successfully`,