From d9e893fa0f5268cd58995b0791056c1198875169 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 24 May 2026 11:00:24 +0300 Subject: [PATCH] Fix tournament matches showing as live on the stream sidebar after finalization Closes #3102 --- .../actions/to.$id.matches.$mid.server.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/features/tournament-match/actions/to.$id.matches.$mid.server.ts b/app/features/tournament-match/actions/to.$id.matches.$mid.server.ts index ed7040d39..521b9d679 100644 --- a/app/features/tournament-match/actions/to.$id.matches.$mid.server.ts +++ b/app/features/tournament-match/actions/to.$id.matches.$mid.server.ts @@ -116,6 +116,7 @@ export const action: ActionFunction = async ({ params, request }) => { let emitMatchUpdate = false; let emitTournamentUpdate = false; + let setIsOver = false; let endedDroppedMatchIds: number[] = []; switch (data._action) { @@ -245,6 +246,7 @@ export const action: ActionFunction = async ({ params, request }) => { emitMatchUpdate = true; emitTournamentUpdate = true; + setIsOver = setOver; break; } @@ -767,6 +769,7 @@ export const action: ActionFunction = async ({ params, request }) => { emitMatchUpdate = true; emitTournamentUpdate = true; + setIsOver = true; break; } @@ -815,6 +818,12 @@ export const action: ActionFunction = async ({ params, request }) => { clearTournamentDataCache(tournamentId); + // update RunningTournaments to make sure sidebar is not showing stale matches at the end + // of the tournament in case the TO is not finalizing the tournament right away + if (setIsOver) { + await tournamentFromDB({ tournamentId, user }); + } + if (emitMatchUpdate) { ChatSystemMessage.send([ {