Add Flutter CI workflow and sync hardening docs

This commit is contained in:
Rijad Zuzo
2026-02-15 20:13:49 +01:00
parent 497805ed3b
commit f1442e89d8
3 changed files with 94 additions and 0 deletions
+19
View File
@@ -22,6 +22,25 @@ Use fake gateway for local/offline development:
flutter run --dart-define=USE_FAKE_BACKEND=true
```
## Background Sync
Background sync (startup + resume + periodic ticks while authenticated) is
enabled by default.
Control flags:
```bash
flutter run \
--dart-define=ENABLE_BACKGROUND_SYNC=true \
--dart-define=BACKGROUND_SYNC_INTERVAL_SECONDS=180
```
Disable it explicitly:
```bash
flutter run --dart-define=ENABLE_BACKGROUND_SYNC=false
```
## Local Persistence Backend
Default local store:
+45
View File
@@ -2,6 +2,51 @@
Updated: 2026-02-15
## Latest Milestone (2026-02-15): Sync Hardening + CI Baseline
Implemented the next production-readiness slice:
- Added lifecycle-aware background sync runner:
- `lib/features/sync/sync_auto_trigger_controller.dart`
- `lib/features/sync/sync_background_runner.dart`
- mounted while authenticated in `lib/main.dart`
- behavior: one trigger on app startup, trigger on app resume, periodic sync
ticks (default every 180s), cooldown/concurrency guarded
- Added runtime config flags:
- `ENABLE_BACKGROUND_SYNC` (default `true`)
- `BACKGROUND_SYNC_INTERVAL_SECONDS` (default `180`)
- in `lib/core/config/app_config.dart`
- Added user-facing rejected mutation handling:
- `lib/features/sync/sync_queue_repository.dart` -> `clearRejections()`
- `lib/features/sync/sync_view.dart` now renders a `Rejected Changes` section
with dismiss action
- Added tests:
- `test/features/sync/sync_auto_trigger_controller_test.dart`
- `test/features/sync/sync_queue_repository_test.dart` rejection clear case
- Added CI workflow:
- `.github/workflows/flutter_ci.yml` (`flutter pub get`, `flutter analyze`,
`flutter test`)
- Updated setup docs:
- `docs/SETUP.md` with background sync flags
Validation for this milestone:
- `flutter analyze` -> pass
- `flutter test` -> pass
### Open Phases (Current)
1. Reminder delivery integration:
- add platform notification scheduler (local notifications) and wire reminder
CRUD/state changes to schedule/cancel/update jobs.
2. Conflict resolution UX:
- current UX shows and dismisses rejections; still missing guided
resolve/retry/inspect flows per entity.
3. Sync trigger maturity:
- add connectivity-aware triggers and backoff policy for repeated failures.
4. Test depth:
- add integration tests for auth + sync + CRUD end-to-end app flows.
## Latest Milestone (2026-02-15): Sync Queue Storage Adapter + Hive Migration
Extended the storage abstraction approach to sync queue persistence: