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 ) {
@@ -787,8 +789,11 @@ class UpdateMachine {
787
789
case Server5xxException () || NetworkException ():
788
790
assert (debugLog ('Transient error polling event queue for $store : $e \n '
789
791
'Backing off, then will retry…' ));
790
- // TODO tell user if transient polling errors persist
791
792
// TODO reset to short backoff eventually
793
+ accumlatedTransientFailureCount++ ;
794
+ if (accumlatedTransientFailureCount > transientFailureCountNotifyThreshold) {
795
+ reportErrorToUserBriefly ('Failed to reach server. Will retry: $e ' );
796
+ }
792
797
await backoffMachine.wait ();
793
798
assert (debugLog ('… Backoff wait complete, retrying poll.' ));
794
799
continue ;
@@ -804,6 +809,7 @@ class UpdateMachine {
804
809
}
805
810
806
811
store.isLoading = false ;
812
+ accumlatedTransientFailureCount = 0 ;
807
813
final events = result.events;
808
814
for (final event in events) {
809
815
await store.handleEvent (event);
You can’t perform that action at this time.
0 commit comments