fix: keep best-of-three grand finals open for results

Allow a separate grand final format and repair prematurely completed finals without dropping accepted games. Replay the correction record alongside subsequent results.
This commit is contained in:
dahyeon committed 2026-11-10 18:49:26 +09:00
1 parent 38a89b5374
commit 7e0cd7cb19
21 files changed
+914 -23

No files matched your search

+29 -2
View File
@@ -118,8 +118,35 @@ Fixed-game Series complete only after all configured GameSlots are filled and ma
draw. First-to Series complete as soon as a team reaches the threshold and cannot
draw.
The legacy double-elimination defaults remain upper=`Match.gameCount`, lower=BO1,
grand final=BO1, reset final=BO1.
Double elimination uses `Match.gameCount` for the upper bracket. The grand final
can be set independently to BO1, BO3, or BO5 before team building. Existing
competitions and requests without an explicit final setting retain the legacy
BO1 default. The lower bracket and any reset final are BO1.
If a BO3 final was mistakenly created as BO1 and has exactly one accepted Riot
game, use the targeted repair after deploying the updated API. It only supports
a finished double-elimination bracket with reset disabled. The default command
is read-only and uses the API's database credentials from the environment:
```sh
pnpm --filter api competition:repair-grand-final --env prod --match-id <match-id>
pnpm --filter api competition:repair-grand-final --env prod --match-id <match-id> --expected-revision <revisionBefore> --apply
```
Verify the preserved game and the new game numbers in the preview first. Apply
records the correction, keeps the existing result, reopens the final, and queues
the usual code assignment and stats refresh. Collect the next set from the
Operations tab using its Riot Match ID.
The built API also includes `dist/modules/global/database/migrations/repair-grand-final-bo3.js`.
Run it with Node and the same flags when the deployment image has no `ts-node`.
Wait for every API instance to run the updated build before applying the repair.
An older build can still display the repaired bracket, but a new result fails
with `Unsupported Competition fact type grand-final-rule-corrected` during
replay. If the repair has already been applied, update the API and retry the
same Riot Match ID. The failed command rolls back; the repair does not need to
be applied again.
### Series Graph