diff options
| author | Adam Malczewski <[email protected]> | 2026-06-01 09:29:54 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-01 09:29:54 +0900 |
| commit | b8bc5c71076d0318291e120e056e8103344493ff (patch) | |
| tree | 8012bc4108f44c1557b175220f672d597d0edb0c /packaging | |
| parent | 97c1b40ead19cdfe54b9a7aeb2c0fdcc1c9653b1 (diff) | |
| download | dispatch-b8bc5c71076d0318291e120e056e8103344493ff.tar.gz dispatch-b8bc5c71076d0318291e120e056e8103344493ff.zip | |
feat(api): extract pure wake-scheduler helpers (nextDailyAfter, recoverScheduleEntry)
Side-effect-free module so missed-wake recovery and rescheduling can be
unit-tested without booting Hono or touching SQLite.
- nextDailyAfter: advances by 24h increments until strictly > now (handles
multi-day gaps in a single step instead of looping a day at a time).
- recoverScheduleEntry: classifies a past next_wake_at into 'fire now,
then advance' vs 'silently advance' based on MISSED_WAKE_GRACE_MS (2h).
- CLAUDE_RESET_OFFSET_HOURS / resetHourFor: single source of truth for the
'+5h reset' display, previously hardcoded in three places.
Includes 12 unit tests covering grace boundaries, multi-day skip, custom
grace windows, and midnight wraparound.
Diffstat (limited to 'packaging')
0 files changed, 0 insertions, 0 deletions
