fix(timing): keep timing the running session when another one is selected

Passings and the session clock followed only the selected session, so
selecting another practice or the next heat while one was running
dropped every lap. They now go to the running session, and Timing and
Race Day show where laps are being recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssandandClaude Opus 5.5 committed 2026-10-17 17:31:59 +02:00
1 parent cdde070c1c
commit 3a6789f42f
13 files changed
+137 -13

No files matched your search

+17
View File
@@ -937,6 +937,23 @@ Checked:
Verified: 265 unit and 75 browser scenarios pass.
### Follow-up: laps dropped when another session was selected (2026-10-17)
The user noticed that the decoder "came alive" only when they started the other Open Practice.
The cause:
- `processDecoderMessage` and the timer tick used `getActiveSession()`, which is the *selected* session.
- With another Open Practice selected (ready) while one still ran, every passing was reported as `no_running_session` and dropped.
- The same happened on Race Day when the next heat was picked during the current one. That heat would also not have finished automatically.
- [x] `getLiveSession` in `timing_logic.js` returns the selected session if it is running or paused, otherwise the most recently started running/paused session, otherwise the selected one. Decoder processing, the session timer tick and the race-calls check use it. `announceRaceFinished(session)` receives the finished session.
- [x] A notice on Timing and Race Day ("Laps are being recorded on X, which is running") with a Show it button.
Verified:
- 266 unit tests pass (selected running, next heat picked, most recent of several, paused, nothing running, empty).
- `tests/browser_live_session.js` runs practice A while B is selected, and sends a real decoder passing. It checks that the passing is counted on A and nothing on B, that the notice shows A, and that Show it selects A and removes the notice.
- The test fails with the old routing ("the passing is counted on the running practice, not dropped") and passes with the fix. 76 browser scenarios pass.
## Documentation maintenance
- [x] Update the architecture's module/dependency inventory as modules change.