generated from nhcarrigan/template
fix: use server-computed endsAt for exploration timer to prevent clock drift #68
Reference in New Issue
Block a user
Delete Branch "fix/exploration-timer-drift"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
startedAt = endsAt - durationMs, then computed asdurationSeconds - (clientNow - startedAt) / 1000— any server/client clock skew directly inflated the resultendsAt(the server-computed completion timestamp) directly inExplorationAreaStateand computes the timer as(endsAt - Date.now()) / 1000, which is immune to clock driftendsAtfall back gracefully to the previousstartedAt-based calculationTest plan
endsAt)startedAtbut noendsAtshould still display a timer via the fallback pathCloses #53
✨ This PR was created with help from Hikari~ 🌸