fix: use server-computed endsAt for exploration timer to prevent clock drift
CI / Lint, Build & Test (pull_request) Successful in 1m10s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m10s

Exploration timers were showing more time than the area's stated duration
when the server clock was ahead of the client clock. The timer now uses
the server-provided endsAt timestamp directly instead of deriving startedAt
from it, making countdowns immune to client/server clock skew. Old saves
without endsAt fall back to the previous startedAt-based calculation.

Closes #53
This commit is contained in:
2026-03-18 16:46:49 -07:00
committed by Naomi Carrigan
parent aede55a13d
commit 53eaebd7d8
3 changed files with 26 additions and 15 deletions
@@ -72,6 +72,12 @@ interface ExplorationAreaState {
*/
startedAt?: number;
/**
* Unix timestamp when the exploration will complete (server-computed, used for
* accurate client-side countdown that is immune to client/server clock drift).
*/
endsAt?: number;
/**
* True after the first successful collect — used for codex unlock detection.
*/