Resume account-scoped pending sync after auth restoration

This commit is contained in:
bponders12-cell 2026-09-01 20:46:10 -04:00
parent f828253695
commit 24a7967125
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,14 @@ final syncManagerProvider = ChangeNotifierProvider<SyncManager>((ref) {
defaultProviderId: 'firebase',
);
final accountSync = ref.watch(firebaseAccountSyncServiceProvider);
// The provider is rebuilt when the account UID changes. If the new account
// already has persisted auth-blocked work, resume it immediately rather than
// waiting for another auth event that may never arrive.
if (ref.read(authNotifierProvider).isAuthenticated) {
manager.retryAuthRequired();
}
ref.listen<AuthState>(authNotifierProvider, (previous, next) {
if (next.isAuthenticated && previous?.isAuthenticated != true) {
manager.retryAuthRequired();