File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -760,6 +760,8 @@ class UpdateMachine {
760
760
761
761
void poll () async {
762
762
final backoffMachine = BackoffMachine ();
763
+ int accumlatedTransientFailureCount = 0 ;
764
+ const transientFailureCountNotifyThreshold = 10 ;
763
765
764
766
while (true ) {
765
767
if (_debugLoopSignal != null ) {
@@ -788,8 +790,11 @@ class UpdateMachine {
788
790
case Server5xxException () || NetworkException ():
789
791
assert (debugLog ('Transient error polling event queue for $store : $e \n '
790
792
'Backing off, then will retry…' ));
791
- // TODO tell user if transient polling errors persist
792
793
// TODO reset to short backoff eventually
794
+ accumlatedTransientFailureCount++ ;
795
+ if (accumlatedTransientFailureCount > transientFailureCountNotifyThreshold) {
796
+ reportErrorToUserBriefly ('Failed to reach server. Will retry: $e ' );
797
+ }
793
798
await backoffMachine.wait ();
794
799
assert (debugLog ('… Backoff wait complete, retrying poll.' ));
795
800
continue ;
@@ -805,6 +810,7 @@ class UpdateMachine {
805
810
}
806
811
807
812
store.isLoading = false ;
813
+ accumlatedTransientFailureCount = 0 ;
808
814
final events = result.events;
809
815
for (final event in events) {
810
816
await store.handleEvent (event);
You can’t perform that action at this time.
0 commit comments