mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-11 17:53:55 +01:00
The phone only pushed its log on screen-init, app resume/pause, or manual "Sync now" -- never on the log action itself -- so a meal could sit locally for many minutes before reaching GitHub (and thus the PC gate). Fire the existing best-effort _autoSync right after a meal is logged, from both the quick-log path (_onLogMeal) and the meal-builder return (_onBuildMeal), so an online device propagates a new meal within seconds. _autoSync is already single-flight and swallows offline/transient failures, so this is a fire-and-forget unawaited call with no new machinery. Offline logging still waits for reconnect + a lifecycle event (a WorkManager backstop is a future follow-up). Verified on device (BL9000EEA0000102): logging a meal advanced the phone's remote food_log.json commit within seconds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtSmzACzJSGyEatgK9exkd |
||
|---|---|---|
| .. | ||
| edit_entry_screen.dart | ||
| food_bank_screen.dart | ||
| history_screen.dart | ||
| log_meal_screen.dart | ||
| meal_builder_screen.dart | ||
| photo_viewer_screen.dart | ||
| settings_screen.dart | ||