This commit is contained in:
2026-08-24 17:59:33 +03:00
parent 1fbe845b30
commit 65a2521156
5 changed files with 136 additions and 24 deletions

View File

@@ -368,7 +368,9 @@
return payload;
} catch (error) {
if (error?.name === "AbortError") {
throw new Error("Превышено время ожидания ответа Stat2TV");
// BUILD109: this helper is used for local DB/session/Agent endpoints too.
// Calling every HTTP timeout a Stat2TV timeout hides the real subsystem.
throw new Error("Превышено время ожидания ответа сервера");
}
throw error;
} finally {
@@ -1529,27 +1531,20 @@ function gameCard(game) {
);
state.selectedGame = discovered.game;
state.selectedMatchDetails = discovered.details || null;
} else if (scheduleGame) {
// BUILD109: the card the operator clicked is already a complete local
// schedule snapshot. Opening the workspace must be immediate; cached
// details/full match data are optional enrichment and are loaded below.
state.selectedGame = scheduleGame;
state.selectedMatchDetails = null;
} else {
try {
const cached = await request(
`/api/hockey/games/${encodeURIComponent(id)}/details?language=${encodeURIComponent(state.language)}`,
{ timeoutMs: 5000 }
);
state.selectedGame = cached.game;
state.selectedMatchDetails = cached.details || null;
} catch (_) {
try {
state.selectedGame = await request(
`/api/hockey/games/${encodeURIComponent(id)}?language=${encodeURIComponent(state.language)}`,
{ timeoutMs: 5000 }
);
state.selectedMatchDetails = null;
} catch (baseError) {
if (!scheduleGame) throw baseError;
state.selectedGame = scheduleGame;
state.selectedMatchDetails = null;
}
}
// Defensive fallback for a stale DOM/list state. This path is local DB
// only and is not used for the normal visible match-card click.
state.selectedGame = await request(
`/api/hockey/games/${encodeURIComponent(id)}?language=${encodeURIComponent(state.language)}`,
{ timeoutMs: 5000 }
);
state.selectedMatchDetails = null;
}
const actualTournamentId = String(