mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 07:28:01 +00:00
7b4ebbf7f5
Pause is tracked as pausedAt (TimeOfDay, ms since local midnight) and paused duration is derived via the naive `clock - pausedAt`. When a pause spans midnight the clock has wrapped to a small value while pausedAt is still large, so the subtraction goes negative and every paused-duration result is corrupted (runtimeState.start resume accumulation, and getExpectedFinish/getCurrent/getRuntimeOffset in timerUtils). Add two currently-failing tests that reproduce this: - runtimeState: full start/pause/resume cycle where the pause crosses midnight, asserting pausedDuration and elapsed exclude the pause. - timerUtils.getRuntimeOffset: over-midnight variant of the paused-offset case (the site carrying the "brakes when crossing midnight" TODO). Both fail today (report ~ -86,100,000 instead of the real 5-minute pause) and will pass once the pause math adopts the wrap-aware primitives (timeCore.elapsedTime / epoch-based tracking). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136N3FnyuUmLJbMNJiZd6YX