@@ -82,13 +82,17 @@ abstract class OfflineFirstWithSupabaseRepository<
8282 return await super .delete <TModel >(instance, policy: policy, query: query);
8383 } on PostgrestException catch (e) {
8484 logger.warning ('#delete supabase failure: $e ' );
85-
8685 if (policy == OfflineFirstDeletePolicy .requireRemote) {
8786 throw OfflineFirstException (e);
8887 }
89-
90- return false ;
88+ } on AuthRetryableFetchException catch (e) {
89+ logger.warning ('#delete supabase failure: $e ' );
90+ if (policy == OfflineFirstDeletePolicy .requireRemote) {
91+ throw OfflineFirstException (e);
92+ }
9193 }
94+
95+ return false ;
9296 }
9397
9498 @override
@@ -105,13 +109,17 @@ abstract class OfflineFirstWithSupabaseRepository<
105109 );
106110 } on PostgrestException catch (e) {
107111 logger.warning ('#get supabase failure: $e ' );
108-
109112 if (policy == OfflineFirstGetPolicy .awaitRemote) {
110113 throw OfflineFirstException (e);
111114 }
112-
113- return < TModel > [];
115+ } on AuthRetryableFetchException catch (e) {
116+ logger.warning ('#get supabase failure: $e ' );
117+ if (policy == OfflineFirstGetPolicy .awaitRemote) {
118+ throw OfflineFirstException (e);
119+ }
114120 }
121+
122+ return < TModel > [];
115123 }
116124
117125 @protected
@@ -124,6 +132,8 @@ abstract class OfflineFirstWithSupabaseRepository<
124132 return await super .hydrate <TModel >(deserializeSqlite: deserializeSqlite, query: query);
125133 } on PostgrestException catch (e) {
126134 logger.warning ('#hydrate supabase failure: $e ' );
135+ } on AuthRetryableFetchException catch (e) {
136+ logger.warning ('#hydrate supabase failure: $e ' );
127137 }
128138
129139 return < TModel > [];
@@ -387,13 +397,17 @@ abstract class OfflineFirstWithSupabaseRepository<
387397 return await super .upsert <TModel >(instance, policy: policy, query: query);
388398 } on PostgrestException catch (e) {
389399 logger.warning ('#upsert supabase failure: $e ' );
390-
391400 if (policy == OfflineFirstUpsertPolicy .requireRemote) {
392401 throw OfflineFirstException (e);
393402 }
394-
395- return instance;
403+ } on AuthRetryableFetchException catch (e) {
404+ logger.warning ('#upsert supabase failure: $e ' );
405+ if (policy == OfflineFirstUpsertPolicy .requireRemote) {
406+ throw OfflineFirstException (e);
407+ }
396408 }
409+
410+ return instance;
397411 }
398412
399413 PostgresChangeFilterType ? _compareToFilterParam (Compare compare) {
0 commit comments