fix(home): "next sync" must reflect the schedule the device is *on*
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
The card's "next sync" was computed locally as `lastSeenAt + interval`, which broke the moment the user PATCHed a new interval: the device is still asleep on whatever schedule was active at its last poll, but the local record now has the new interval, so we'd display a misleading "in 2m" after a 5→3 min change. Fix: server stamps `nextPollExpectedAt` on every poll (200/304/204), PWA reads it directly. The timestamp doesn't move when settings are edited — only when the device actually polls and picks up a new schedule. Same field also drives the settings-sheet "Next update" preview, which had the same flaw. Side effects: - `markSeen()` now flushes on the 204 paths too — they previously set lastSeenAt without flushing (latent bug for devices with no approved images / missing assets). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user