mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-11 15:54:04 +01:00
The phone now walks the panel on its own -- login, active order, delivery, menu -- parses the dishes and banks them, so the feature works with the PC switched off. Read-only: nothing here logs a meal. `package:http` has no cookie jar, so the `SESSION` cookie is read off the login response and replayed by hand. `Response.headers` folds duplicate `set-cookie` values into one comma-joined string, so the parser splits on both `,` and `;` and looks for the named cookie rather than assuming the header holds only it -- tested against both orderings and against a panel that sets no session cookie at all. Android-only, as decided: the panel sends no CORS headers, so a browser cannot call it. `refreshDelivery` checks `kIsWeb` first and returns the unsupported reason without touching the network. No `dart:io` anywhere -- `package:http` compiles for web, it is the panel that refuses, not the toolchain, so this needs no `_io`/`_web` seam. The idempotency guard is ported with its teeth: `addManualEntry` restamps `editedAt` unconditionally, so re-banking an unchanged dish republishes the whole curated bank to every peer. `bankDishes` compares the nutritional fields first and returns a write *count*, which is what the tests assert on -- "the entry exists" passes while this misbehaves. The comparison is numeric, not string, so `270 == 270.0` is a match exactly as in Python's `_matches`. Every failure becomes a reason string, never a throw, so a catering outage cannot break the caller: a rejected login, a delivery whose dishes all fail the unit check, and missing credentials each have a test. One test bug worth noting: the assertion that nothing is logged was missing an `await` and so was comparing a Future against `isEmpty` -- the single most important guarantee in this file was passing vacuously until the split forced it to run. Test files split three ways for the 250-line cap; block counts checked against the pre-split file (16 either side), not just a green suite. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQpCiPaSbyRpwsLkH3dgsX |
||
|---|---|---|
| .. | ||
| app_settings_service.dart | ||
| average_service.dart | ||
| background_check_service.dart | ||
| background_sync_service.dart | ||
| background_tasks_io.dart | ||
| background_tasks_web.dart | ||
| background_tasks.dart | ||
| budget_history_service.dart | ||
| budget_schedule.dart | ||
| day_status_service.dart | ||
| desktop_wrapper.dart | ||
| document_store_factory.dart | ||
| document_store_indexeddb.dart | ||
| document_store_io.dart | ||
| document_store_web.dart | ||
| document_store.dart | ||
| due_slot_check.dart | ||
| firebase_backend.dart | ||
| firebase_client.dart | ||
| foodbank_service_manual.dart | ||
| foodbank_service.dart | ||
| frame_stats.dart | ||
| fuzzy.dart | ||
| github_client_factory_io.dart | ||
| github_client_factory_web.dart | ||
| github_client_factory.dart | ||
| google_platform_io.dart | ||
| google_platform_web.dart | ||
| google_platform.dart | ||
| google_sign_in_backend.dart | ||
| kuchnia_client.dart | ||
| kuchnia_credential_service.dart | ||
| kuchnia_errors.dart | ||
| kuchnia_import.dart | ||
| kuchnia_orders.dart | ||
| kuchnia_parse.dart | ||
| kuchnia_spread.dart | ||
| log_storage_service.dart | ||
| meal_schedule_history.dart | ||
| meal_schedule_service.dart | ||
| notification_backend_factory.dart | ||
| notification_backend_io.dart | ||
| notification_backend_web.dart | ||
| notification_backend.dart | ||
| notification_service.dart | ||
| sync_device_id.dart | ||
| sync_health.dart | ||
| sync_merge_banks.dart | ||
| sync_merge_budget.dart | ||
| sync_merge_kuchnia.dart | ||
| sync_merge_schedule.dart | ||
| sync_merge.dart | ||
| sync_service.dart | ||
| sync_settings.dart | ||
| sync_state_factory_io.dart | ||
| sync_state_factory_web.dart | ||
| sync_state_factory.dart | ||
| token_vault_factory.dart | ||
| token_vault_io.dart | ||
| token_vault_web.dart | ||
| token_vault.dart | ||