Commit Graph

9 Commits

Author SHA1 Message Date
larssand
3373f8dddd Protect live race results and shrink cross-browser staleness
Investigated whether two admin browsers open at once can overwrite each
other's changes, per an explicit request to report the risk before
making bigger changes. Found that POST /api/state always replaces the
entire stored document with a client's in-memory copy, with no version
check and no per-field merge - and a browser only ever pushes, never
re-fetching server state after page load except on the Overlay view.
An idle browser's next save, even an unrelated edit, could silently
revert another browser's more recent changes, worst case a live race's
in-progress results.

Two scoped fixes instead of the bigger optimistic-locking rework (that
needs real UX decisions about conflicting saves, deferred separately):

1. server.js now remembers which session results were just written by
   a real live decoder passing (/api/passings) and protects that key
   for 15 seconds against being reverted by a stale full-state save,
   while still applying the rest of that save normally.
2. Every non-Overlay view now quietly refreshes its data in the
   background every 15 seconds (skipped while a local edit is
   pending), without ever calling renderView(), so it can never
   discard an open, unsaved edit form - shrinking how stale a
   browser's next save can be from hours to seconds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 12:56:58 +02:00
larssand
9c74c1f256 add version 2026-09-05 13:39:50 +02:00
larssand
285babcfcf add more stats to mobile and fix refresh stint 2026-09-04 16:41:51 +02:00
larssand
2d56b74731 Add local and public QR sharing for training profiles 2026-09-03 20:15:13 +02:00
larssand
f561dd8feb new raceday and backup 2026-09-01 07:07:23 +02:00
larssand
c6262aceab fix live leaderbord details 2026-08-28 21:12:43 +02:00
larssand
5f79228941 Add configurable manifest-driven race audio system 2026-08-28 13:29:27 +02:00
larssand
8ea8b3a84e Add multi-decoder split and pit timing support 2026-08-25 19:45:40 +02:00
larssand
5a6e51c51b Add persistence and SQLite integration tests 2026-08-24 19:08:21 +02:00