brackt/app/hooks
Chris Parsons a91c108393
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m35s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 1m15s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Fix draft timer display drifting due to server-client clock skew
The countdown display used data.expiresAt (a server-side Unix timestamp)
subtracted from client Date.now(). When the server clock is ahead of the
client by ~2-3s (observed in production), the display inflated by that
delta — causing 2:02 instead of 2:00 on pick start, short-crediting the
chess clock increment, and the commissioner's adjust-time-bank dialog
disagreeing with the visible countdown.

Fix: replace all server expiresAt timestamps with a client-local expiry
computed from the server-provided timeRemaining integer
(Date.now() + timeRemaining * 1000). The skew then cancels algebraically:
server_remaining = server_expiresAt - pickMadeAt
                 = (client_schedule + Δ + bank*1000) - (client_pick + Δ)
                 = client_expiresAt - client_pick  ✓

Three sites updated: handleTimerPickStarted, handleDraftStateSync
(reconnect), and the initial useState seed from loader data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 00:19:02 -07:00
..
__tests__ Fix unhandled rejection from session ping when network is unavailable (#56) 2026-05-27 16:14:14 +00:00
useDraftAuthRecovery.ts Fix unhandled rejection from session ping when network is unavailable (#56) 2026-05-27 16:14:14 +00:00
useDraftNotifications.ts Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
useDraftRoomState.ts Show "Syncing Draft State..." overlay during draft reconnection (#361) 2026-04-30 20:33:00 -07:00
useDraftSocket.ts Change Socket.IO connection error logging from error to log level (#448) 2026-05-19 15:47:41 -07:00
useDraftSocketEvents.ts Fix draft timer display drifting due to server-client clock skew 2026-06-06 00:19:02 -07:00
useFocusTrap.ts fix: resolve all 48 WCAG 2.2 AA accessibility issues (#439) 2026-05-17 20:11:38 -07:00
useLocalTimezone.ts Simplify sports season display and add local timezone hints (#434) 2026-05-15 16:04:07 -07:00
useMediaQuery.ts fix: eliminate queue tab flash on mobile by using useSyncExternalStore (#46) 2026-02-28 09:54:14 -08:00
useRoundTransition.ts Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
useSortableData.ts Fix oxlint errors. 2026-03-22 20:41:44 -07:00