From 2fd5e888f7dd2589f66edbcf1726fdc62e6c1ff3 Mon Sep 17 00:00:00 2001 From: bponders12-cell Date: Tue, 1 Sep 2026 23:12:28 -0400 Subject: [PATCH] feat: eagerly start persistent sync reconciliation --- lib/main.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index a48f390..93a1190 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,11 +8,11 @@ import 'firebase_options.dart'; import 'core/theme/theme.dart'; import 'core/router.dart'; import 'features/records/records_service.dart'; +import 'services/sync/sync_providers.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - // Authoritative Firebase initialization try { await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, @@ -47,17 +47,17 @@ class _MotorcycleDashAppState extends ConsumerState { @override void initState() { super.initState(); + // Eagerly construct the sync manager so persisted outbox work is + // reconciled immediately at app startup, not only after visiting a sync UI. + ref.read(syncManagerProvider); _initDeepLinks(); } Future _initDeepLinks() async { _appLinks = AppLinks(); - try { final initialUri = await _appLinks.getInitialLink(); - if (initialUri != null) { - _handleDeepLink(initialUri); - } + if (initialUri != null) _handleDeepLink(initialUri); } catch (_) {} _linkSubscription = _appLinks.uriLinkStream.listen(