Feature #65
closedEpic #63: Followed meal plan and Today’s meals
Synchronise calendar schedules and keep notification delivery device-local
0%
Description
Imported from GitHub issue 296.
Source milestone: Milestone 4.
Source labels: enhancement, ready-for-agent.
Original state: closed.
What to build¶
Type: AFK
Store one account-owned calendar schedule in Firestore for the followed plan, so devices agree on the current day while each independently opts into local notifications.
Acceptance criteria¶
- Store schedule starting day/date, time zone, plan-instance identity and revision/generation in Firestore with owner-only validation and safe concurrent updates. The shared schedule belongs to the account’s followed plan.
- Derive the current day from the shared schedule zone on every device. Travel never silently changes it; explicit schedule edits propagate to all devices. Keep whole-day completion independent of calendar progression.
- Notification permission, delivery on/off, pending requests and delivery bookkeeping remain device-local. Receiving/creating a shared schedule does not enable delivery on other phones. Keep existing Premium and platform delivery restrictions; no server push or unverified iOS claim.
- Following alone creates no schedule or permission prompt. Setup uses starting day/date and a visible schedule time zone; denied local permission leaves plan viewing/progress available.
- “Turn off notifications on this device” cancels only local requests and leaves calendar progression running. Separate “Stop schedule” ends the shared schedule and resumes completion-driven advancement from the shared position, including advancing past completed days.
- Switching ends the old shared schedule and starts the new followed plan with notifications off, preserving completion/positions. Other devices cancel when changes arrive; explain that disconnected devices may deliver old requests. Reset, confirmed access loss and unavailable-plan termination reconcile across devices under existing rules.
- Legacy migration seeds only absent shared schedule state from an authenticated owning context. Existing shared state wins; retries and concurrent devices cannot resurrect old schedules. Coordinate with GitHub 295 migration.
- Schedule edits/stops/switches are server-acknowledged and invalidate stale local checkpoints. Handle local cancellation/scheduling failure with durable safe recovery; do not promise atomic cancellation on disconnected phones. Keep same-plan replacement recovery where compatible.
- Test two-device convergence, independent local opt-in, local-off versus shared-stop, permission denial/recovery, shared-zone dates/travel/DST, concurrent migration/reset/switch, stale revisions and failure recovery. Localise copy and update documentation.
Blocked by¶
Acceptance evidence — 4 November 2026¶
All nine criteria are supported by implementation and automated checks. Two-device scenarios use separate simulated device stores; Firestore rules were checked with a disposable emulator. Physical two-phone synchronisation and Android instrumentation execution remain unverified. Validation after the migration fixes: 715 client Vitest tests, 10 Node release checks, TypeScript and lint pass. No deployment is implied.
No data to display