CI / build + unit + e2e (pull_request) Failing after 12m10s
The world always runs at WORLD_TIME_SCALE = 24 (lib/worldClock.ts). A server
background tick (instrumentation.ts -> startBackgroundTick, 1 s interval)
advances the sim with no open browser; idle-pause freezes the clock exactly
while no plane is flying or in repair. Fresh worlds start year 2000
(STARTING_CLOCK_MS in seed.ts).
- Removed: POST /api/sim + OpenAPI entry, applyTimeControls/clampTimeScale,
lib/timeScale.ts, LeftPane pause button + scale slider machinery,
ISS-057 slow-on-landing/resume in flyPlane.
- Snapshot simState is now { clockMs } only; client extrapolates at the fixed
rate between polls and freezes while idle (useSimClock).
- New test-only hook POST /api/test/set-timescale behind FLIGHT_TEST_HOOKS=1
(sibling of set-health); all e2e setScale helpers call it, afterEach restores
the world rate. E2E pause tests replaced by idle-pause assertions; sim.spec.ts
activates the world via set-health + /repair for advance/expiry tests.
10 lines
374 B
TypeScript
10 lines
374 B
TypeScript
import { startBackgroundTick } from '@/lib/sim/engine';
|
|
|
|
// ISS-117 (v0.52.0): the world clock advances on a ~1 s background tick even with nobody polling —
|
|
// started once at server boot (Next ≥15 instrumentation hook; runs under `next dev` and `next start`).
|
|
export function register() {
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
startBackgroundTick();
|
|
}
|
|
}
|