diet-guard/app/test
Krzysztof kuhy Rudnicki d2e62bf210 Read the meal schedule from a forward-only history (Dart)
The phone/desktop half of the previous commit, so both devices now derive
their slots the same way. Still no edit surface, so `MealScheduleService`
returns the default and the derived hours are unchanged at 08/12/16/20.

`slot.dart` takes the schedule as a required argument, mirroring `_slots.py`,
and `slot_test.dart` gains the same every-hour x several-schedules sweep the
Python suite runs. That sweep is the contract: the two must agree on which
checkpoint a meal satisfies for every cell, not merely on the endpoints.

Also fixes a real bug this feature would otherwise have shipped on top of.
`syncToSlots` used the slot hour as the notification id but only cancelled ids
in the *current* schedule, so changing 08/12/16/20 -> 08/11/14/17/20 would
leave ids 12 and 16 posted with nothing that could ever cancel them: permanent
reminders for checkpoints that no longer exist. It now sweeps the whole 0..23
id space. The regression test was confirmed to fail against the old loop
(4 cancels vs 24) rather than passing vacuously.

MealScheduleService.current degrades to the default when the singleton is
absent, so `due_slot_check` deliberately does not init() it -- that would
reach path_provider from widget tests and from the WorkManager isolate before
main() runs. main.dart owns the real init, and background_sync_service.dart
does its own, since a fresh isolate has its own static state and would
otherwise nag against the default four meals.

609 Dart tests, 761 Python, both suites green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159b4E5hh512jYUeaJVNxfM
2026-08-16 14:41:37 +02:00
..
desktop Split the remaining seven Dart test files 2026-08-15 20:53:55 +02:00
models Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
screens Pin meal pills to one row; drop the "Logged" restatement 2026-08-16 14:18:39 +02:00
services Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
widgets Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
fake_notifications.dart Add OAuth device flow, background notifications, and fix AGP9 release crash (Milestones 3–4) 2026-06-25 17:29:23 +02:00
fake_secure_storage.dart Add Flutter half of cross-device sync (Milestone 3) 2026-06-22 22:42:27 +02:00
firebase_backend_google_test.dart Split the last four Dart lib files; file-length gate now reports zero 2026-08-15 21:07:24 +02:00
google_platform_test.dart Add Google sign-in support for the Firebase sync account 2026-08-12 23:36:10 +02:00
google_sign_in_backend_test.dart Add Google sign-in support for the Firebase sync account 2026-08-12 23:36:10 +02:00
keyboard_operability_test.dart Stop two keyboard tests hanging, and make the CI mirror mirror CI 2026-08-04 21:50:15 +02:00
repo_invariants_test.dart Automate CLAUDE.md's structural rules, then cut it to 189 lines 2026-08-15 16:39:57 +02:00
widget_test.dart app: run the companion app's desktop target as a web build 2026-07-20 16:31:32 +02:00