Time update #7

Closed
opened 2026-09-18 15:12:26 +02:00 by kamilkrzywda · 1 comment
Owner

Time update is skipping second - i assume its only updated server side, can we make it render on frontend add just update/sync periodically from backend?

Time update is skipping second - i assume its only updated server side, can we make it render on frontend add just update/sync periodically from backend?
Author
Owner

Fixed in v0.16.1 (PR #18, merge commit eb69359a), deployed to https://flight.dev.kkhost.pl and verified (/api/version → 0.16.1).

The sim clock is now extrapolated on the frontend between server polls: new lib/useSimClock.ts hook anchors to each polled snapshot and advances at real-time × timeScale (frozen while paused — mirrors the server's tick-on-read model), so seconds tick smoothly instead of jumping once per second. Pause/scale changes take effect optimistically before the confirming snapshot arrives; on any POST failure the next poll re-anchors automatically.

New e2e test (panes.spec.ts) asserts strict monotonic advance across samples at 1000× plus a total-advance sanity bound; existing clock assertions pass unchanged (render shape identical).

Fixed in **v0.16.1** (PR #18, merge commit `eb69359a`), deployed to https://flight.dev.kkhost.pl and verified (`/api/version` → 0.16.1). The sim clock is now extrapolated on the frontend between server polls: new `lib/useSimClock.ts` hook anchors to each polled snapshot and advances at real-time × timeScale (frozen while paused — mirrors the server's tick-on-read model), so seconds tick smoothly instead of jumping once per second. Pause/scale changes take effect optimistically before the confirming snapshot arrives; on any POST failure the next poll re-anchors automatically. New e2e test (`panes.spec.ts`) asserts strict monotonic advance across samples at 1000× plus a total-advance sanity bound; existing clock assertions pass unchanged (render shape identical).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/Flight-Ops#7