From db6a9f19e4171367ef72b1ab96789e8ee5b5ef8a Mon Sep 17 00:00:00 2001 From: larssand Date: Wed, 4 Nov 2026 21:34:06 +0100 Subject: [PATCH] fix(race): finish the lap you are on, one clock owner, edits survive refresh, participants editable (1.59.0) --- CHANGELOG.md | 14 ++++++++ package-lock.json | 4 +-- package.json | 2 +- src/app.js | 21 +++++++++--- src/decoder_runtime.js | 9 +++++ src/event_manager_controller.js | 22 ++++++++++-- src/event_manager_view.js | 23 +++++++------ src/event_race_logic.js | 59 ++++++++++++++++++++++++++++++-- src/runtime_services.js | 55 ++++++++++++++++++++++++------ src/session_control.js | 2 ++ src/timing_logic.js | 35 +++++++++++++++++-- tests/audio_runtime.test.js | 31 +++++++++++++++-- tests/browser_race_setup.js | 10 ++++++ tests/race_day_fixes.test.js | 60 +++++++++++++++++++++++++++++++++ tests/race_timing_logic.test.js | 4 ++- tests/run.js | 1 + 16 files changed, 313 insertions(+), 39 deletions(-) create mode 100644 tests/race_day_fixes.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index bd14e36..51712ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,20 @@ The application version is maintained in `package.json` and displayed in the adm No changes recorded yet. +## 1.59.0 - 2026-11-04 + +### Changed + +- Finish the lap you are on: when time is up each driver finishes at their first crossing after their own time (own clock with flying/staggered start); later crossings no longer count. The heat closes as soon as everyone has finished, or when the last car still out has had about 1.5 of its own lap time (at least the follow-up time, at most the max lap time), instead of a fixed 10-15 s. +- The extra "Final lap" call after "Time has expired. Finish the lap you are on." is gone. + +### Fixed + +- "Time has expired" was called once per open window (Race Day, Timing on another PC, the drivers' board). Only the browser running the race (on the decoder, or the one that started the heat) calls the clock and closes the heat now. +- A change made in an edit dialog (for example a heat's length 5 -> 3 min) could be lost when the dialog had been open for more than 15 s: the background refresh replaced the heat, race or driver it was editing. The refresh now updates them in place. +- A new qualifying or final time, start type or follow-up time in Race format now also reaches heats not run yet. +- Race participants: drivers left out at creation can be ticked again in Manage (the list showed only those chosen), drivers from other classes can be added, and practice and qualifying heats not run yet follow the list (a new driver joins the smallest heat). + ## 1.58.0 - 2026-11-04 ### Added diff --git a/package-lock.json b/package-lock.json index 826ddf4..220689e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rc-racecore", - "version": "1.58.0", + "version": "1.59.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rc-racecore", - "version": "1.58.0", + "version": "1.59.0", "hasInstallScript": true, "dependencies": { "better-sqlite3": "^12.11.1", diff --git a/package.json b/package.json index 61fc4ab..3e38026 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-racecore", - "version": "1.58.0", + "version": "1.59.0", "private": true, "description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence", "engines": { diff --git a/src/app.js b/src/app.js index e5dcea4..b280bc8 100644 --- a/src/app.js +++ b/src/app.js @@ -19,7 +19,7 @@ import { renderRaceFormatField, renderRaceFormatContextCard, getRaceSummaryItems import { normalizeRaceTeam as normalizeRaceTeamLogic, normalizeStoredRacePreset as normalizeStoredRacePresetLogic, getRaceFormatPresets as getRaceFormatPresetsLogic, applyRaceFormatPreset as applyRaceFormatPresetLogic, buildRaceFormatConfigFromForm as buildRaceFormatConfigFromFormLogic, normalizeEvent as normalizeEventLogic, normalizeBrandingConfig as normalizeBrandingConfigLogic, resolveEventBranding as resolveEventBrandingLogic, getRaceManageStatuses as getRaceManageStatusesLogic, buildDefaultRaceWizardDraft as buildDefaultRaceWizardDraftLogic, getRaceWizardPreset as getRaceWizardPresetLogic, applyRaceWizardPresetDefaults as applyRaceWizardPresetDefaultsLogic, ensureRaceParticipantsConfigured as ensureRaceParticipantsConfiguredLogic, buildRaceSession as buildRaceSessionLogic, buildOpenPracticeBundle as buildOpenPracticeBundleLogic, buildTrackSession as buildTrackSessionLogic, createSponsorRounds as createSponsorRoundsLogic, buildRaceSessionsFromWizard as buildRaceSessionsFromWizardLogic, getRaceWizardSessionPlan as getRaceWizardSessionPlanLogic, getEventDrivers as getEventDriversLogic, getEventTeams as getEventTeamsLogic, getTeamDriverPool as getTeamDriverPoolLogic, reassignTeamMembers as reassignTeamMembersLogic, findEventTeamForPassing as findEventTeamForPassingLogic, generateQualifyingForRace as generateQualifyingForRaceLogic, reseedUpcomingQualifying as reseedUpcomingQualifyingLogic, moveDriversIntoQualifyingHeat as moveDriversIntoQualifyingHeatLogic, parseQualifyingHeatName as parseQualifyingHeatNameLogic, generateFinalsForRace as generateFinalsForRaceLogic, applyBumpsForRace as applyBumpsForRaceLogic, buildEventSchedule as buildEventScheduleLogic, normalizeHeatOrder, planSeedingGroups } from "./event_race_logic.js"; -import { getSessionTypeLabel as getSessionTypeLabelLogic, getStatusLabel as getStatusLabelLogic, isUntimedSession as isUntimedSessionLogic, getActiveSession as getActiveSessionLogic, getLiveSession as getLiveSessionLogic, getSessionTargetMs as getSessionTargetMsLogic, getSessionLapWindow as getSessionLapWindowLogic, isCountedPassing as isCountedPassingLogic, getVisiblePassings as getVisiblePassingsLogic, getPassingValidationLabel as getPassingValidationLabelLogic, getSessionTiming as getSessionTimingLogic, ensureSessionResult as ensureSessionResultLogic, buildLeaderboard as buildLeaderboardLogic, formatLapDelta as formatLapDeltaLogic, formatLeaderboardGap as formatLeaderboardGapLogic, getCompetitorElapsedMs as getCompetitorElapsedMsLogic, getCompetitorPassings as getCompetitorPassingsLogic, getCompetitorSeedMetric as getCompetitorSeedMetricLogic, getSessionEntrants as getSessionEntrantsLogic, buildPracticeStandings as buildPracticeStandingsLogic, getQualifyingPointsValue as getQualifyingPointsValueLogic, isHighPointsTable as isHighPointsTableLogic, compareNumberSet as compareNumberSetLogic, buildQualifyingTieBreakNote as buildQualifyingTieBreakNoteLogic, hasQualifyingPrimaryTie as hasQualifyingPrimaryTieLogic, buildQualifyingStandings as buildQualifyingStandingsLogic, formatTeamActiveMemberLabel as formatTeamActiveMemberLabelLogic, buildTeamRaceStandings as buildTeamRaceStandingsLogic, buildSessionChannelStats as buildSessionChannelStatsLogic, buildTeamStintLog as buildTeamStintLogLogic, getSessionGridEntries as getSessionGridEntriesLogic, getSessionGridOrder as getSessionGridOrderLogic, ensureSessionDriverOrder as ensureSessionDriverOrderLogic, buildFinalStandings as buildFinalStandingsLogic, getTrackRecordMs as getTrackRecordMsLogic } from "./timing_logic.js"; +import { getFinishWait as getFinishWaitLogic, getSessionTypeLabel as getSessionTypeLabelLogic, getStatusLabel as getStatusLabelLogic, isUntimedSession as isUntimedSessionLogic, getActiveSession as getActiveSessionLogic, getLiveSession as getLiveSessionLogic, getSessionTargetMs as getSessionTargetMsLogic, getSessionLapWindow as getSessionLapWindowLogic, isCountedPassing as isCountedPassingLogic, getVisiblePassings as getVisiblePassingsLogic, getPassingValidationLabel as getPassingValidationLabelLogic, getSessionTiming as getSessionTimingLogic, ensureSessionResult as ensureSessionResultLogic, buildLeaderboard as buildLeaderboardLogic, formatLapDelta as formatLapDeltaLogic, formatLeaderboardGap as formatLeaderboardGapLogic, getCompetitorElapsedMs as getCompetitorElapsedMsLogic, getCompetitorPassings as getCompetitorPassingsLogic, getCompetitorSeedMetric as getCompetitorSeedMetricLogic, getSessionEntrants as getSessionEntrantsLogic, buildPracticeStandings as buildPracticeStandingsLogic, getQualifyingPointsValue as getQualifyingPointsValueLogic, isHighPointsTable as isHighPointsTableLogic, compareNumberSet as compareNumberSetLogic, buildQualifyingTieBreakNote as buildQualifyingTieBreakNoteLogic, hasQualifyingPrimaryTie as hasQualifyingPrimaryTieLogic, buildQualifyingStandings as buildQualifyingStandingsLogic, formatTeamActiveMemberLabel as formatTeamActiveMemberLabelLogic, buildTeamRaceStandings as buildTeamRaceStandingsLogic, buildSessionChannelStats as buildSessionChannelStatsLogic, buildTeamStintLog as buildTeamStintLogLogic, getSessionGridEntries as getSessionGridEntriesLogic, getSessionGridOrder as getSessionGridOrderLogic, ensureSessionDriverOrder as ensureSessionDriverOrderLogic, buildFinalStandings as buildFinalStandingsLogic, getTrackRecordMs as getTrackRecordMsLogic } from "./timing_logic.js"; import { normalizeTrackLayouts, getTrackLayoutIdAt, getTrackLayoutLabel, nextTrackLayoutLabel, findRaceSessionBlockingLayoutChange, isPracticeSessionType, isTrackLayoutInUse } from "./track_layouts_logic.js"; import { renderDashboardView, renderClassesView, renderDriversView, renderCarsView } from "./core_views.js"; @@ -219,7 +219,13 @@ const announceRaceFinished = (finished = null) => { if (podium.length > 1) triggerRaceAudio("podium", { variables: { podium: podium.map((row) => row.displayName || row.driverName).join(", ") } }); }; const announceRaceClockEvent = (eventKey, session) => triggerRaceAudio(eventKey, { logData: { raceId: session.eventId, sessionId: session.id } }); -const handleSessionTimerTick = () => handleSessionTimerTickHelper({ getActiveSession: getLiveSession, isUntimedSession, getSessionTiming, saveState, getLastFinishAnnouncementSessionId: () => lastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId: (value) => { lastFinishAnnouncementSessionId = value; }, announceRaceFinished, announceRaceClockEvent }); +const handleSessionTimerTick = () => handleSessionTimerTickHelper({ getActiveSession: getLiveSession, isUntimedSession, getSessionTiming, saveState, getLastFinishAnnouncementSessionId: () => lastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId: (value) => { lastFinishAnnouncementSessionId = value; }, announceRaceFinished, announceRaceClockEvent, + // The race browser: the one on the decoder, or with no decoder anywhere, the one that started the heat. + isClockOwner: (session) => !overlayMode && (Boolean(state.decoder?.connected) || readClockOwner() === session.id), + getFinishWait: (session) => getFinishWaitLogic(session, state.resultsBySession[session.id]?.competitors, { maxLapMs: getSessionLapWindow(session).maxLapMs }) }); +const CLOCK_OWNER_KEY = "rc_clock_owner"; +const readClockOwner = () => { try { return sessionStorage.getItem(CLOCK_OWNER_KEY) || ""; } catch { return ""; } }; +const writeClockOwner = (sessionId) => { try { sessionStorage.setItem(CLOCK_OWNER_KEY, sessionId); } catch { /* private mode */ } }; const cancelRaceStart = () => raceAudioEngine.cancelStartSequence(); const startSessionWithAudio = (session, callbacks) => { // Only the casual, come-and-go practice modes (open_practice - the standalone "Quick @@ -554,6 +560,7 @@ function resetSessionData(session) { session.resultsResetAt = Date.now(); delete state.resultsBySession[session.id]; session.followUpStartedAt = null; + session.finishWaitUntil = null; session.calledAt = null; // A heat (anything but an Open/Free Practice that runs all evening) goes back to "ready": // the clock is back at zero and it can be started again. @@ -1794,6 +1801,8 @@ const TRANSLATIONS = { "events.edit": "Redigera", "events.sessions": "Sessioner", "events.participants": "Deltagare", + "events.other_class_participants": "Förare från andra klasser ({count})", + "events.participants_sync_hint": "Ändringar här följer med till practice och kvalheat som inte körts än. En ny förare hamnar i kvalheatet med minst förare.", "events.select_participants": "Välj racedeltagare", "events.select_all_participants": "Markera alla", "events.clear_participants": "Rensa deltagare", @@ -2796,7 +2805,7 @@ const TRANSLATIONS = { "guide.race_format_5": "Finaltid och Final-start styr varje finalleg, ofta med positionsstart.", "guide.race_format_6": "Bump-up per final och Reservera bump-platser används om förare ska kunna flyttas från lägre final till nästa main.", "guide.race_format_7": "Källa för finaler avgör om finalerna seedas från practice eller kvalrankingen.", - "guide.race_format_8": "Follow-up tid ger en extra uppsamlingsperiod efter ordinarie racetid innan heatet verkligen stängs.", + "guide.race_format_8": "När tiden är slut säger speakern \"Tiden är slut, slutför pågående varv\". Varje förare är i mål vid sin första passering efter sin egen tid, och passeringar efter det räknas inte. Heatet stängs så fort alla gått i mål, eller senast när den som är kvar ute fått cirka 1,5 av sin egen varvtid på sig (aldrig mer än Max varvtid). Follow-up tid är den kortaste väntetiden.", "guide.race_format_9": "Min varvtid filtrerar bort shortcuts och felträffar. Exempel: på en 16-sekundersbana kan du sätta 11 sekunder som min-gräns.", "guide.race_format_10": "Max varvtid är en statistikgräns. En längre passering avslutar stinten och utesluts ur pace-snittet, men varvet räknas fortfarande i race. Exempel: 120 sekunder ger en ny stint efter två minuters uppehåll.", "guide.race_format_11": "Preset låter dig snabbt fylla raceformat med vettiga grundvärden för kort teknisk bana, klubbrace, IFMAR-liknande upplägg eller endurance.", @@ -3773,6 +3782,8 @@ const TRANSLATIONS = { "events.edit": "Edit", "events.sessions": "Sessions", "events.participants": "Participants", + "events.other_class_participants": "Drivers from other classes ({count})", + "events.participants_sync_hint": "Changes here carry over to practice and qualifying heats not run yet. A new driver joins the qualifying heat with the fewest drivers.", "events.select_participants": "Select race participants", "events.select_all_participants": "Select all", "events.clear_participants": "Clear participants", @@ -4775,7 +4786,7 @@ const TRANSLATIONS = { "guide.race_format_5": "Final duration and Final start control each final leg, often with position start.", "guide.race_format_6": "Bump-up per main and Reserve bump slots are used if drivers should move from a lower final into the next main.", "guide.race_format_7": "Source for finals decides whether finals are seeded from practice or qualifying standings.", - "guide.race_format_8": "Follow-up time adds an extra collection period after the scheduled race time before the heat is actually closed.", + "guide.race_format_8": "When time is up the announcer says \"Time has expired, finish the lap you are on\". Each driver finishes at their first crossing after their own time, and crossings after that do not count. The heat closes as soon as everyone has finished, or at the latest when a car still out has had about 1.5 of its own lap time (never more than Max lap time). Follow-up time is the shortest wait.", "guide.race_format_9": "Min lap time filters out shortcuts and false hits. Example: on a 16-second track you can set 11 seconds as the minimum.", "guide.race_format_10": "Max lap time is a statistics boundary. A longer passing ends the stint and is excluded from pace averages, but the lap still counts in the race. Example: 120 seconds starts a new stint after a two-minute break.", "guide.race_format_11": "Preset lets you quickly fill the race format with sensible defaults for a short technical track, club race, IFMAR-like setup or endurance.", @@ -5179,6 +5190,7 @@ function normalizeSession(session = {}) { pausedAt: Number.isFinite(Number(session?.pausedAt)) ? Number(session.pausedAt) : null, totalPausedMs: Math.max(0, Number(session?.totalPausedMs || 0) || 0), followUpPausedMs: Math.max(0, Number(session?.followUpPausedMs || 0) || 0), + finishWaitUntil: Number(session?.finishWaitUntil || 0) || null, audioAnnouncements: Array.isArray(session?.audioAnnouncements) ? session.audioAnnouncements.map(String).filter(Boolean) : [], assignments, driverIds: Array.isArray(session?.driverIds) ? session.driverIds.map(String).filter(Boolean) : [], @@ -5725,6 +5737,7 @@ async function runOperationalStart(session, sequenceCallbacks, onTone) { session = state.sessions.find((item) => item.id === session.id) || session; state.activeSessionId = session.id; beginSessionControl(session); + writeClockOwner(session.id); session.trackLayoutId = getTrackLayoutIdAt(state.trackLayouts); lastFinishAnnouncementSessionId = null; lastOverlayLeaderKeyBySession[session.id] = null; diff --git a/src/decoder_runtime.js b/src/decoder_runtime.js index 005eeae..29c3bda 100644 --- a/src/decoder_runtime.js +++ b/src/decoder_runtime.js @@ -5,6 +5,7 @@ import { isSuspectLap, getSuspectReferenceLaps, releaseSettledSuspectLaps } from import { shouldCallPracticePersonalBest } from "./practice_callouts_logic.js"; import { normalizeRaceAudioSettings } from "./race_audio.js"; import { decoderClockCheck, describeDecoderClockSkew } from "./decoder_clock_check.js"; +import { getCompetitorEndTs } from "./timing_logic.js"; const PRACTICE_SESSION_TYPES = new Set(["open_practice", "free_practice", "practice"]); // Last personal best *called* per driver, per practice day and layout (practice_callouts_logic.js). @@ -482,6 +483,12 @@ export function processDecoderMessageHelper(msg, deps, decoderRole = "main") { entry.startTimestamp = session.startedAt || timestamp; } + // Finished (crossed after its time was up): later crossings are not laps. + if (entry.finishedAt) { + report("after_finish", "ignored"); + return true; + } + const baseTs = entry.lastTimestamp || entry.startTimestamp || session.startedAt || timestamp; const lapMs = Math.max(0, timestamp - baseTs); const { minLapMs, maxLapMs } = getSessionLapWindow(session); @@ -551,6 +558,8 @@ export function processDecoderMessageHelper(msg, deps, decoderRole = "main") { entry.laps += 1; entry.lastLapMs = lapMs; entry.lastTimestamp = timestamp; + const endTs = getCompetitorEndTs(session, entry); + if (endTs && timestamp >= endTs) entry.finishedAt = timestamp; // A suspect lap counts like any other lap until someone removes it; it is only not called // out as a personal best or record below. diff --git a/src/event_manager_controller.js b/src/event_manager_controller.js index 01cea9a..7cbb3c4 100644 --- a/src/event_manager_controller.js +++ b/src/event_manager_controller.js @@ -1,4 +1,4 @@ -import { orderSessionsForRunning, moveSessionInRunningOrder } from "./event_race_logic.js"; +import { orderSessionsForRunning, moveSessionInRunningOrder, applyFormatToPendingSessions, syncParticipantsToSessions } from "./event_race_logic.js"; import { setSessionGroupOpen } from "./event_manager_view.js"; let activeManageTab = "setup"; // Maps a data-target anchor id (used by the step-card overview and the race-summary @@ -130,6 +130,15 @@ export function renderEventManagerView(context) { .map((d) => ``) .join(""); const raceDrivers = event.mode === "race" ? getEventDrivers(event) : []; + // The checklist offers every driver of the class (a driver left out can be ticked again), + // the chosen ones from other classes, and the rest of the club folded away. + const chosenIds = event.raceConfig?.participantsConfigured ? (event.raceConfig.driverIds || []) : null; + const participantChoices = event.mode === "race" + ? state.drivers.filter((driver) => !event.classId || driver.classId === event.classId || (chosenIds || []).includes(driver.id)) + : []; + const otherClassChoices = event.mode === "race" && event.classId + ? state.drivers.filter((driver) => !participantChoices.includes(driver)).sort((a, b) => String(a.name || "").localeCompare(String(b.name || ""))) + : []; const teamDriverPool = event.mode === "race" ? getTeamDriverPool(event) : { drivers: [], fallback: false }; const raceTeams = event.mode === "race" ? getEventTeams(event) : []; if (selectedTeamEditId && !raceTeams.some((team) => team.id === selectedTeamEditId)) { @@ -187,6 +196,8 @@ export function renderEventManagerView(context) { renderManageStatusBadgeView, selectedParticipantCount, raceDrivers, + participantChoices, + otherClassChoices, teamDriverPool, showTeamsSection, parseQualifyingHeatName, @@ -564,10 +575,15 @@ export function renderEventManagerView(context) { if (event.mode === "race") { const persistRaceParticipants = () => { - const selectedIds = Array.from(document.querySelectorAll(".race-participant:checked")).map((node) => node.value); + const beforeIds = getEventDrivers(event).map((driver) => driver.id); + const checked = new Set(Array.from(document.querySelectorAll(".race-participant:checked")).map((node) => node.value)); + // Keep the entry order: the ones already in stay where they were, new ones go last. + const selectedIds = [...beforeIds.filter((id) => checked.has(id)), ...[...checked].filter((id) => !beforeIds.includes(id))]; event.raceConfig.driverIds = selectedIds; event.raceConfig.participantsConfigured = true; + syncParticipantsToSessions(state.sessions.filter((session) => session.eventId === event.id), beforeIds, selectedIds); saveState(); + refreshManager(); }; document.querySelectorAll(".race-participant").forEach((node) => { @@ -727,6 +743,7 @@ export function renderEventManagerView(context) { e.preventDefault(); const form = new FormData(e.currentTarget); const config = buildRaceFormatConfigFromForm(form, event); + const before = { ...(event.raceConfig || {}) }; updateEvent((item) => ({ ...item, raceConfig: { @@ -734,6 +751,7 @@ export function renderEventManagerView(context) { teams: getEventTeams(item), }, })); + applyFormatToPendingSessions(state.sessions.filter((session) => session.eventId === event.id), before, config); saveState(); refreshManager(); }); diff --git a/src/event_manager_view.js b/src/event_manager_view.js index a508c85..fedb1f2 100644 --- a/src/event_manager_view.js +++ b/src/event_manager_view.js @@ -47,6 +47,8 @@ export function renderEventManagerMarkup(context) { renderManageStatusBadgeView, selectedParticipantCount, raceDrivers, + participantChoices = raceDrivers, + otherClassChoices = [], teamDriverPool, showTeamsSection, parseQualifyingHeatName, @@ -358,21 +360,22 @@ export function renderEventManagerMarkup(context) { -
- ${raceDrivers - .map((driver) => { - const checked = event.raceConfig.participantsConfigured - ? (event.raceConfig.driverIds || []).includes(driver.id) - : true; - return ` + ${(() => { + const card = (driver) => { + const checked = event.raceConfig.participantsConfigured + ? (event.raceConfig.driverIds || []).includes(driver.id) + : driver.classId === event.classId; + return ` `; - }) - .join("")} -
+ }; + return `
${participantChoices.map(card).join("")}
+ ${otherClassChoices.length ? `
${t("events.other_class_participants", { count: otherClassChoices.length })}
${otherClassChoices.map(card).join("")}
` : ""} +

${t("events.participants_sync_hint")}

`; + })()} diff --git a/src/event_race_logic.js b/src/event_race_logic.js index bd2c106..7015cf0 100644 --- a/src/event_race_logic.js +++ b/src/event_race_logic.js @@ -584,13 +584,43 @@ export function getEventDrivers(event, { state }) { // from this list (a fallback qualifying/finals grid with no practice data yet, a // staggered heat's start-order announcement) should follow the order a club admin // actually built the entry list in, not an unrelated internal array order. - const classDriverIds = new Set(classDrivers.map((driver) => driver.id)); - const byId = new Map(classDrivers.map((driver) => [driver.id, driver])); + // A chosen entry may come from another class (one driver, two classes). + const byId = new Map(state.drivers.map((driver) => [driver.id, driver])); return (event.raceConfig.driverIds || []) - .filter((id) => classDriverIds.has(id)) + .filter((id) => byId.has(id)) .map((id) => byId.get(id)); } +// The entry list changed: sessions not run yet follow it. A removed driver leaves them; an +// added one joins each practice that holds the whole entry list, and the qualifying heat with +// the fewest drivers (the same heat number in every round still to run). Run sessions and +// finals are left alone. +export function syncParticipantsToSessions(sessions, beforeIds = [], afterIds = []) { + const removed = new Set(beforeIds.filter((id) => !afterIds.includes(id))); + const added = afterIds.filter((id) => !beforeIds.includes(id)); + const pending = sessions.filter((session) => session.status === "ready" && !session.startedAt && ["practice", "qualification"].includes(session.type)); + const without = (list) => (list || []).filter((id) => !removed.has(id)); + pending.forEach((session) => { + session.driverIds = without(session.driverIds); + session.manualGridIds = without(session.manualGridIds); + }); + if (!added.length) return; + const join = (session, id) => { + if (!(session.driverIds || []).includes(id)) session.driverIds = [...(session.driverIds || []), id]; + if (Array.isArray(session.manualGridIds) && !session.manualGridIds.includes(id)) session.manualGridIds = [...session.manualGridIds, id]; + }; + const keep = new Set(beforeIds.filter((id) => !removed.has(id))); + pending.filter((session) => session.type === "practice" && [...keep].every((id) => (session.driverIds || []).includes(id))) + .forEach((session) => added.forEach((id) => join(session, id))); + const heats = pending.map((session) => ({ session, parsed: parseQualifyingHeatName(session.name) })).filter((item) => item.parsed); + added.forEach((id) => { + if (!heats.length) return; + const size = (heat) => heats.filter((item) => item.parsed.heat === heat).reduce((max, item) => Math.max(max, (item.session.driverIds || []).length), 0); + const heatNumbers = [...new Set(heats.map((item) => item.parsed.heat))].sort((a, b) => size(a) - size(b) || a - b); + heats.filter((item) => item.parsed.heat === heatNumbers[0]).forEach((item) => join(item.session, id)); + }); +} + export function getEventTeams(event, { normalizeRaceTeam }) { @@ -1114,3 +1144,26 @@ export function buildEventSchedule(event, sessions) { }; }); } + +// A changed race format reaches the sessions not run yet: when e.g. "qualifying time" goes +// 5 -> 3 min, every ready practice/qualifying session gets 3 min. Only fields whose format +// value changed are applied, so a heat edited by hand keeps its own other values. +export function applyFormatToPendingSessions(sessions, before = {}, after = {}) { + const fields = { + practice: [["qualDurationMin", "durationMin"]], + qualification: [["qualDurationMin", "durationMin"], ["qualStartMode", "startMode"], ["followUpSec", "followUpSec"], ["qualSeedLapCount", "seedBestLapCount"], ["qualSeedMethod", "seedMethod"]], + final: [["finalDurationMin", "durationMin"], ["finalStartMode", "startMode"], ["followUpSec", "followUpSec"]], + }; + let changed = 0; + sessions.forEach((session) => { + if (session.status !== "ready" || session.startedAt) return; + let touched = false; + (fields[session.type] || []).forEach(([configKey, sessionKey]) => { + if (after[configKey] === undefined || after[configKey] === before[configKey]) return; + session[sessionKey] = after[configKey]; + touched = true; + }); + if (touched) changed += 1; + }); + return changed; +} diff --git a/src/runtime_services.js b/src/runtime_services.js index 97d2e83..34c9998 100644 --- a/src/runtime_services.js +++ b/src/runtime_services.js @@ -103,19 +103,32 @@ export async function stopManagedAmmcHelper({ ammc, t, getBackendUrl }) { } } +// The background refresh updates items with the same id in place instead of replacing them, +// so a form or button that already holds a session/event/driver (an open edit dialog, Run +// again) still changes the live one - not a copy that is thrown away on the next save. +export function keepIdentityById(previous, next) { + const byId = new Map((Array.isArray(previous) ? previous : []).filter((item) => item && item.id).map((item) => [item.id, item])); + return next.map((item) => { + const existing = item && item.id ? byId.get(item.id) : null; + if (!existing || existing === item) return item; + Object.keys(existing).forEach((key) => { if (!(key in item)) delete existing[key]; }); + return Object.assign(existing, item); + }); +} + export function applyPersistedStateHelper(persisted, deps) { const { state, getDefaultBackendUrl, DEFAULT_LANGUAGE, DEFAULT_THEME, AVAILABLE_THEMES, normalizeDriver, normalizeCar, normalizeEvent, normalizeSession, normalizeStoredRacePreset, normalizeObsOverlaySettings, normalizeTrainingState, normalizeRaceAudioSettings = (value = {}) => value || {}, normalizeTrackLayouts = (value) => (Array.isArray(value) ? value : []), applyTheme } = deps; state.classes = persisted.classes || []; - state.drivers = (persisted.drivers || []).map((driver) => normalizeDriver(driver)).filter((driver) => driver.name); - state.cars = (persisted.cars || []).map((car) => normalizeCar(car)).filter((car) => car.name); - state.events = (persisted.events || []).map((event) => normalizeEvent(event)); - state.sessions = (persisted.sessions || []).map((session) => normalizeSession(session)); + state.drivers = keepIdentityById(state.drivers, (persisted.drivers || []).map((driver) => normalizeDriver(driver)).filter((driver) => driver.name)); + state.cars = keepIdentityById(state.cars, (persisted.cars || []).map((car) => normalizeCar(car)).filter((car) => car.name)); + state.events = keepIdentityById(state.events, (persisted.events || []).map((event) => normalizeEvent(event))); + state.sessions = keepIdentityById(state.sessions, (persisted.sessions || []).map((session) => normalizeSession(session))); state.resultsBySession = persisted.resultsBySession || {}; state.audioEventLog = Array.isArray(persisted.audioEventLog) ? persisted.audioEventLog.slice(0, 500) : []; state.training = normalizeTrainingState(persisted.training); state.activeSessionId = persisted.activeSessionId || null; state.trackLayouts = normalizeTrackLayouts(persisted.trackLayouts); - state.series = (Array.isArray(persisted.series) ? persisted.series : []).map((series) => normalizeSeries(series)).filter((series) => series.id); + state.series = keepIdentityById(state.series, (Array.isArray(persisted.series) ? persisted.series : []).map((series) => normalizeSeries(series)).filter((series) => series.id)); state.raceDays = normalizeRaceDays(persisted.raceDays); state.settings = { wsUrl: persisted.settings?.wsUrl || state.settings.wsUrl || "ws://127.0.0.1:9000", @@ -420,11 +433,26 @@ export function announceRaceFinishedHelper({ t, getActiveSession, pushOverlayEve if (session) pushOverlayEvent("finish", `${session.name} • ${t("timing.race_finished")}`, { silentCue: true }); } -export function handleSessionTimerTickHelper({ getActiveSession, isUntimedSession, getSessionTiming, saveState, getLastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId, announceRaceFinished, announceRaceClockEvent = () => {} }) { +// isClockOwner: only the browser that runs the race (connected to the decoder) calls the +// clock and closes the heat - every other open window (Timing on a second PC, the drivers' +// board) would otherwise call "time has expired" too. Those only close a heat left running +// a minute past its limit, in case the race browser was closed. +export function handleSessionTimerTickHelper({ getActiveSession, isUntimedSession, getSessionTiming, saveState, getLastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId, announceRaceFinished, announceRaceClockEvent = () => {}, isClockOwner = () => true, getFinishWait = () => ({ allFinished: true, closeAt: null }), now = () => Date.now() }) { const active = getActiveSession(); if (!active || active.status !== "running") return { changed: false }; if (isUntimedSession(active)) return { changed: false }; const timing = getSessionTiming(active); + if (!isClockOwner(active)) { + const limit = Number(active.finishWaitUntil || 0) || (Number(active.startedAt || 0) + Number(timing.targetMs || 0) + Math.max(0, Number(active.totalPausedMs || 0)) + 120000); + if (timing.remainingMs > 0 || now() < limit + 60000) return { changed: false }; + active.status = "finished"; + active.endedAt = now(); + active.finishedByTimer = true; + active.followUpStartedAt = null; + active.finishWaitUntil = null; + saveState(); + return { changed: true }; + } if (!Array.isArray(active.audioAnnouncements)) active.audioAnnouncements = []; let changed = false; const announceOnce = (marker, eventKey) => { @@ -440,16 +468,21 @@ export function handleSessionTimerTickHelper({ getActiveSession, isUntimedSessio if (changed) saveState(); return { changed }; } + // "Time has expired. Finish the lap you are on." - then each car finishes at its next + // crossing, and the heat closes when all have (or the wait runs out). announceOnce("time_expired", "time_expired"); - if (!["open_practice", "free_practice", "practice"].includes(String(active.type || ""))) announceOnce("final_lap", "final_lap"); - if (Number(active.followUpSec || 0) > 0) { - if (!active.followUpStartedAt) { active.followUpStartedAt = Date.now(); saveState(); return { changed: true }; } - if (timing.followUpRemainingMs > 0) { if (changed) saveState(); return { changed }; } + const wait = getFinishWait(active); + if (!active.followUpStartedAt) { active.followUpStartedAt = now(); changed = true; } + if (!wait.allFinished && wait.closeAt && now() < wait.closeAt) { + if (active.finishWaitUntil !== wait.closeAt) { active.finishWaitUntil = wait.closeAt; changed = true; } + if (changed) saveState(); + return { changed }; } active.status = "finished"; - active.endedAt = Date.now(); + active.endedAt = now(); active.finishedByTimer = true; active.followUpStartedAt = null; + active.finishWaitUntil = null; if (getLastFinishAnnouncementSessionId() !== active.id) { announceRaceFinished(active); setLastFinishAnnouncementSessionId(active.id); } saveState(); return { changed: true }; diff --git a/src/session_control.js b/src/session_control.js index 0b9d6e7..6ca89db 100644 --- a/src/session_control.js +++ b/src/session_control.js @@ -4,6 +4,7 @@ export function beginSession(session, nowTs = Date.now()) { session.endedAt = null; session.finishedByTimer = false; session.followUpStartedAt = null; + session.finishWaitUntil = null; session.pausedAt = null; session.totalPausedMs = 0; session.followUpPausedMs = 0; @@ -24,6 +25,7 @@ export function finishSession(session, nowTs = Date.now()) { session.endedAt = nowTs; session.finishedByTimer = false; session.followUpStartedAt = null; + session.finishWaitUntil = null; session.pausedAt = null; return session; } diff --git a/src/timing_logic.js b/src/timing_logic.js index 4c024a8..02c46bf 100644 --- a/src/timing_logic.js +++ b/src/timing_logic.js @@ -39,6 +39,34 @@ export function getLiveSession({ state }) { +// "Finish the lap you are on" (EFRA/IFMAR): when a car's time is up, its next crossing is its +// finish and later ones don't count. Staggered/flying starts have a clock per car. +const ROLLING_SESSION_TYPES = new Set(["open_practice", "free_practice"]); +export function getCompetitorEndTs(session, row) { + if (ROLLING_SESSION_TYPES.has(String(session?.type || "")) || !(Number(session?.durationMin) > 0)) return null; + const personal = session.startMode === "staggered" || session.startMode === "flying"; + const startTs = Number(personal ? row?.startTimestamp : session.startedAt || row?.startTimestamp) || 0; + if (!startTs) return null; + return startTs + Number(session.durationMin) * 60000 + Math.max(0, Number(session.totalPausedMs || 0) || 0); +} + +// When a heat whose time is up may close: as soon as every car on track has crossed after its +// own time, else at the latest when the slowest still-out car has had ~1.5 of its own lap +// time to come round (never sooner than the follow-up time, never longer than max lap time). +export function getFinishWait(session, competitors = {}, { maxLapMs = Infinity } = {}) { + const followMs = Math.max(0, Number(session?.followUpSec || 0) || 0) * 1000; + const rows = Object.values(competitors || {}).filter((row) => getCompetitorEndTs(session, row) !== null && (Number(row.laps || 0) > 0 || row.finishedAt)); + const unfinished = rows.filter((row) => !row.finishedAt); + const closeAt = unfinished.length + ? Math.max(...unfinished.map((row) => { + const lapMs = Number(row.lastLapMs || row.bestLapMs || 0) || 0; + const graceMs = Math.max(followMs, Math.min(lapMs * 1.5, Number.isFinite(maxLapMs) && maxLapMs > 0 ? maxLapMs : Infinity)); + return getCompetitorEndTs(session, row) + graceMs; + })) + : null; + return { allFinished: rows.length > 0 && unfinished.length === 0, closeAt, cars: rows.length, finished: rows.length - unfinished.length }; +} + export function getSessionTargetMs(session, { isUntimedSession }) { if (isUntimedSession(session)) { return null; @@ -124,8 +152,11 @@ export function getSessionTiming(session, nowTs = Date.now(), { getSessionTarget const followUpMs = Math.max(0, Number(session?.followUpSec || 0) || 0) * 1000; const followUpStartedAt = Number(session?.followUpStartedAt || 0) || 0; const followUpPausedMs = Math.max(0, Number(session?.followUpPausedMs || 0) || 0); - const followUpActive = Boolean(followUpStartedAt && followUpMs > 0); - const followUpRemainingMs = followUpActive ? Math.max(0, followUpMs - Math.max(0, clockNow - followUpStartedAt - followUpPausedMs)) : 0; + const finishWaitUntil = session?.status === "running" ? Number(session?.finishWaitUntil || 0) || 0 : 0; + const followUpActive = Boolean(followUpStartedAt && (followUpMs > 0 || finishWaitUntil)); + const followUpRemainingMs = !followUpActive ? 0 + : finishWaitUntil ? Math.max(0, finishWaitUntil - clockNow) + : Math.max(0, followUpMs - Math.max(0, clockNow - followUpStartedAt - followUpPausedMs)); return { targetMs, elapsedMs, diff --git a/tests/audio_runtime.test.js b/tests/audio_runtime.test.js index cbb45ea..398691b 100644 --- a/tests/audio_runtime.test.js +++ b/tests/audio_runtime.test.js @@ -51,15 +51,40 @@ test("session timer emits each race-audio clock marker once without changing fin setLastFinishAnnouncementSessionId: () => {}, announceRaceFinished: () => announced.push("race_finished"), announceRaceClockEvent: (key) => announced.push(key), + getFinishWait: () => wait, + now: () => clock, }); + let clock = 1_000_000; + let wait = { allFinished: false, closeAt: clock + 20_000 }; run(); run(); remainingMs = 29_000; run(); remainingMs = 9_000; run(); - remainingMs = 0; run(); - assert.deepEqual(announced, ["one_minute_remaining", "thirty_seconds_remaining", "ten_seconds_remaining", "time_expired", "final_lap"]); - assert.equal(active.status, "running"); + remainingMs = 0; run(); run(); + assert.deepEqual(announced, ["one_minute_remaining", "thirty_seconds_remaining", "ten_seconds_remaining", "time_expired"], "said once, and no separate 'final lap'"); + assert.equal(active.status, "running", "waits for the cars to finish their lap"); assert.ok(active.followUpStartedAt); + assert.equal(active.finishWaitUntil, wait.closeAt); assert.ok(saves >= 4); + wait = { allFinished: true, closeAt: null }; run(); + assert.equal(active.status, "finished", "closes as soon as every car has crossed after its time"); + assert.deepEqual(announced.slice(-1), ["race_finished"]); +}); + +test("session timer: a car still out closes the heat at the wait limit; other windows stay quiet", () => { + const make = () => ({ id: "s2", eventId: "e1", type: "qualification", status: "running", startedAt: 1, followUpSec: 10, audioAnnouncements: [] }); + const deps = (active, extra) => ({ + getActiveSession: () => active, isUntimedSession: () => false, + getSessionTiming: () => ({ remainingMs: 0, targetMs: 300_000 }), saveState: () => {}, + getLastFinishAnnouncementSessionId: () => null, setLastFinishAnnouncementSessionId: () => {}, + announceRaceFinished: () => {}, announceRaceClockEvent: (key) => extra.announced.push(key), ...extra.deps, + }); + const owner = make(); const ownerLog = { announced: [], deps: { getFinishWait: () => ({ allFinished: false, closeAt: 50_000 }), now: () => 50_001 } }; + handleSessionTimerTickHelper(deps(owner, ownerLog)); + assert.equal(owner.status, "finished"); + const other = make(); const otherLog = { announced: [], deps: { isClockOwner: () => false, now: () => 310_000 } }; + handleSessionTimerTickHelper(deps(other, otherLog)); + assert.deepEqual(otherLog.announced, [], "a second window never calls the clock"); + assert.equal(other.status, "running", "and leaves closing the heat to the race browser"); }); test("race audio can ignore a mismatched configured voice and select the announcement language", () => { diff --git a/tests/browser_race_setup.js b/tests/browser_race_setup.js index f99ddb4..0f711ed 100644 --- a/tests/browser_race_setup.js +++ b/tests/browser_race_setup.js @@ -58,6 +58,16 @@ export async function runRaceSetupSmoke({ evaluate, navigate, fill, savedState, assert.ok(quals.length >= 2 && quals.every((session) => /^Q[12] H\d+$/.test(session.name) && session.generated), `qualifying heats per round: ${quals.map((session) => session.name)}`); assert.equal(club.raceConfig.qualifyingRounds, 2); console.log("PASS wizard builds qualifying as Q H heats"); + // A driver left out can be ticked again, and the heats not run yet follow the list. + await click("event-manage-" + club.id); + await waitFor(async () => (await evaluate('document.querySelectorAll(".race-participant").length')) > 0, "participant list"); + const first = await evaluate('document.querySelector(".race-participant:checked").value'); + await evaluate(`document.querySelector('.race-participant[value="${first}"]').click()`); + await waitFor(async () => !(await savedState()).sessions.some((session) => session.eventId === club.id && session.type === "qualification" && session.driverIds.includes(first)), "unticked driver leaves the heats"); + await waitFor(async () => Boolean(await evaluate(`Boolean(document.querySelector('.race-participant[value="${first}"]:not(:checked)'))`)), "unticked driver still listed"); + await evaluate(`document.querySelector('.race-participant[value="${first}"]').click()`); + await waitFor(async () => (await savedState()).sessions.some((session) => session.eventId === club.id && session.type === "qualification" && session.driverIds.includes(first)), "ticked again: back in a heat"); + console.log("PASS race participants can be changed after creation and the heats follow"); } await navigate("race_setup", "raceWizardStepForm"); await editEvent(race, "race_setup", "raceWizardStepForm"); diff --git a/tests/race_day_fixes.test.js b/tests/race_day_fixes.test.js new file mode 100644 index 0000000..505cee6 --- /dev/null +++ b/tests/race_day_fixes.test.js @@ -0,0 +1,60 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { getCompetitorEndTs, getFinishWait } from "../src/timing_logic.js"; +import { syncParticipantsToSessions, applyFormatToPendingSessions } from "../src/event_race_logic.js"; +import { keepIdentityById } from "../src/runtime_services.js"; + +test("finish the lap: each car's own end, then the heat closes when all crossed or the wait runs out", () => { + const flying = { type: "qualification", startMode: "flying", durationMin: 5, startedAt: 0, followUpSec: 10, totalPausedMs: 0 }; + assert.equal(getCompetitorEndTs(flying, { startTimestamp: 4000 }), 304000, "own clock from own first crossing"); + const mass = { ...flying, startMode: "position", startedAt: 1000 }; + assert.equal(getCompetitorEndTs(mass, { startTimestamp: 1000 }), 301000); + assert.equal(getCompetitorEndTs({ ...mass, type: "open_practice" }, {}), null, "rolling practice has no end"); + + const out = { a: { laps: 10, startTimestamp: 1000, lastLapMs: 30000, finishedAt: 302000 }, b: { laps: 9, startTimestamp: 1000, lastLapMs: 32000 } }; + const wait = getFinishWait(mass, out); + assert.equal(wait.allFinished, false); + assert.equal(wait.closeAt, 301000 + 48000, "1.5 x the slow car's own lap, longer than the 10 s follow-up"); + assert.equal(getFinishWait(mass, out, { maxLapMs: 40000 }).closeAt, 301000 + 40000, "never longer than max lap time"); + out.b.finishedAt = 320000; + assert.equal(getFinishWait(mass, out).allFinished, true); +}); + +test("the entry list reaches the sessions not run yet", () => { + const sessions = [ + { id: "p", type: "practice", status: "ready", driverIds: ["a", "b", "c"] }, + { id: "q11", name: "Q1 H1", type: "qualification", status: "ready", driverIds: ["a", "b"], manualGridIds: ["a", "b"] }, + { id: "q12", name: "Q1 H2", type: "qualification", status: "ready", driverIds: ["c"], manualGridIds: ["c"] }, + { id: "q21", name: "Q2 H1", type: "qualification", status: "ready", driverIds: ["a", "b"] }, + { id: "q22", name: "Q2 H2", type: "qualification", status: "ready", driverIds: ["c"] }, + { id: "done", name: "Q0 H1", type: "qualification", status: "finished", startedAt: 1, driverIds: ["a", "b"] }, + ]; + syncParticipantsToSessions(sessions, ["a", "b", "c"], ["a", "c", "d"]); + const ids = (id) => sessions.find((session) => session.id === id).driverIds; + assert.deepEqual(ids("p"), ["a", "c", "d"]); + assert.ok(!ids("q11").includes("b") && !ids("q21").includes("b"), "b left every heat to run"); + assert.deepEqual(ids("q11"), ["a", "d"], "d joins the smallest heat (a tie goes to the lower heat)"); + assert.deepEqual(ids("q21"), ["a", "d"], "the same heat number in every round"); + assert.deepEqual(ids("q12"), ["c"]); + assert.deepEqual(ids("done"), ["a", "b"], "a run heat is history"); +}); + +test("a changed race format reaches the sessions not run yet", () => { + const sessions = [ + { type: "qualification", status: "ready", durationMin: 5, startMode: "flying" }, + { type: "qualification", status: "finished", startedAt: 1, durationMin: 5 }, + { type: "final", status: "ready", durationMin: 5 }, + { type: "practice", status: "ready", durationMin: 5 }, + ]; + applyFormatToPendingSessions(sessions, { qualDurationMin: 5, finalDurationMin: 5, qualStartMode: "flying" }, { qualDurationMin: 3, finalDurationMin: 5, qualStartMode: "flying" }); + assert.deepEqual(sessions.map((session) => session.durationMin), [3, 5, 5, 3]); +}); + +test("the background refresh keeps the objects a form already holds", () => { + const held = { id: "s1", durationMin: 5, old: true }; + const next = keepIdentityById([held], [{ id: "s1", durationMin: 3 }, { id: "s2" }]); + assert.equal(next[0], held, "same object"); + assert.deepEqual(held, { id: "s1", durationMin: 3 }, "with the server's values"); + held.durationMin = 4; + assert.equal(next[0].durationMin, 4, "so an edit through the held reference is not lost"); +}); diff --git a/tests/race_timing_logic.test.js b/tests/race_timing_logic.test.js index 11760a6..dc8bfda 100644 --- a/tests/race_timing_logic.test.js +++ b/tests/race_timing_logic.test.js @@ -208,7 +208,9 @@ test("getEventDrivers follows the order participants were selected in, not the d assert.deepEqual(getEventDrivers(event, { state }).map((driver) => driver.id), ["d4", "d2", "d1"], "matches selection order, not directory order, and excludes d3 who was never selected"); const stale = { classId: "2wd", raceConfig: { participantsConfigured: true, driverIds: ["d4", "d5", "d1"] } }; - assert.deepEqual(getEventDrivers(stale, { state }).map((driver) => driver.id), ["d4", "d1"], "drops a selected id that no longer belongs to this event's class (d5 is 4wd)"); + assert.deepEqual(getEventDrivers(stale, { state }).map((driver) => driver.id), ["d4", "d5", "d1"], "keeps a chosen driver from another class (one driver, two classes)"); + const gone = { classId: "2wd", raceConfig: { participantsConfigured: true, driverIds: ["d4", "deleted", "d1"] } }; + assert.deepEqual(getEventDrivers(gone, { state }).map((driver) => driver.id), ["d4", "d1"], "drops a driver that no longer exists"); const unconfigured = { classId: "2wd", raceConfig: {} }; assert.deepEqual(getEventDrivers(unconfigured, { state }).map((driver) => driver.id), ["d1", "d2", "d3", "d4"], "before participants are configured, falls back to every driver in the class"); diff --git a/tests/run.js b/tests/run.js index 1638e9d..b3825fd 100644 --- a/tests/run.js +++ b/tests/run.js @@ -1,4 +1,5 @@ import "./auth.test.js"; +import "./race_day_fixes.test.js"; import "./race_list.test.js"; import "./day_schedule.test.js"; import "./race_day_live.test.js";