mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-11 14:27:39 +01:00
Same change todo just took, for the same reason: app/'s desktop target is a
Flutter web build in a Chrome --app window, so FlutterSecureStorage resolves
to the web backend (AES-encrypted localStorage, keyed inside the browser
profile). Nothing outside the page can write that store — `secret-tool`
targets libsecret, which only a Linux embedder build would read, and a Dart
CLI cannot even import flutter_secure_storage, since it is a Flutter plugin
that fails to resolve on the VM. Both verified rather than assumed.
The wrapper is the one process that can read the filesystem and serve the
page, which is exactly why it already holds the GitHub token instead of the
browser (see github_proxy.dart). So the sync account now arrives the same
way: loadAccount() falls back to GET /sync-account when the store is empty
and persists the result, making the route a one-shot provisioning step
rather than a standing dependency.
It reads ~/.config/crdt-sync/{firebase.json,password} — the same pair
`diet_guard sync` already uses — so the machine keeps one source of truth.
Off unless CRDT_SYNC_SERVE_ACCOUNT is set, and 404 (not 403) when disabled so
a probe cannot tell the route exists. On Android there is no wrapper: the
request simply fails and loadAccount() returns null exactly as before.
clearAccount() writes an opt-out marker the fallback checks, so Disconnect
cannot be silently undone by the next launch re-adopting the account.
518 tests, analyzer clean, pre-commit clean. Pinned to crdt_sync_dart-v0.8.0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177xwzcpfpWG2qca8Mr39q9
|
||
|---|---|---|
| .. | ||
| 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 | ||
| foodbank_service.dart | ||
| frame_stats.dart | ||
| fuzzy.dart | ||
| github_client_factory_io.dart | ||
| github_client_factory_web.dart | ||
| github_client_factory.dart | ||
| github_device_auth.dart | ||
| log_storage_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_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 | ||