diet-guard/app/lib
Krzysztof kuhy Rudnicki c093c22ae0
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
Auto-sync on a Firebase-only device, and provision with no window
Two bugs, found because headless provisioning silently did nothing here while
it worked in todo.

`_autoSync` returned early unless `settings.isConfigured`, which means "has a
GitHub token". A desktop connected only to Firebase therefore never synced at
all -- not on this run, not ever -- and since the provisioning fallback is
reached through openFirebase(), it could never provision either. This is the
same defect workout_app's push() already documents ("Gating on the GitHub
token alone silently dropped every push from a device connected only to
Firebase -- and once the mirror is retired that would be every device").
Either backend now counts.

--provision-sync-account then does the setup with no window: the account
lives in origin-keyed localStorage so the page must run, but --headless=new
runs it without ever mapping a window. Startup auto-sync calls loadAccount(),
the wrapper fallback provisions, the process exits.

Verified after the fix, having watched it fail twice before it:
FlutterSecureStorage.firebase.account now holds a real AES payload in the
desktop profile's localStorage. The time budget is 45s rather than todo's
15s -- this log is an order of magnitude larger.

Usage:  CRDT_SYNC_SERVE_ACCOUNT=1 diet-guard-app --provision-sync-account

522 tests, analyzer and pre-commit clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177xwzcpfpWG2qca8Mr39q9
2026-08-09 22:00:53 +02:00
..
desktop Make the sync-account route testable, and cover every branch 2026-08-09 21:49:28 +02:00
models Show weekly and monthly average intake on both devices 2026-08-09 14:59:40 +02:00
screens Auto-sync on a Firebase-only device, and provision with no window 2026-08-09 22:00:53 +02:00
services Let the desktop provision its sync account from the wrapper 2026-08-09 21:41:08 +02:00
ui Make the meal gate usable without a pointer on a 1366x768 screen 2026-07-30 16:21:27 +02:00
widgets Show weekly and monthly average intake on both devices 2026-08-09 14:59:40 +02:00
main.dart Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:18:42 +02:00