Skip to content

Commit b482211

Browse files
committed
Reoprt non-transient polling errors.
Signed-off-by: Zixuan James Li <[email protected]>
1 parent adda69e commit b482211

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/model/store.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,6 @@ class UpdateMachine {
730730
} catch (e) {
731731
assert(debugLog('Error fetching initial snapshot: $e\n'
732732
'Backing off, then will retry…'));
733-
// TODO perhaps suppress this message if error transient
734-
reportErrorToUserBriefly('Error loading server data, will retry: $e');
735733
await (backoffMachine ??= BackoffMachine()).wait();
736734
assert(debugLog('… Backoff wait complete, retrying initial fetch.'));
737735
}
@@ -780,6 +778,7 @@ class UpdateMachine {
780778
switch (e) {
781779
case ZulipApiException(code: 'BAD_EVENT_QUEUE_ID'):
782780
assert(debugLog('Lost event queue for $store. Replacing…'));
781+
reportErrorToUserBriefly('Reconnecting to server.');
783782
await store._globalStore._reloadPerAccount(store.accountId);
784783
dispose();
785784
debugLog('… Event queue replaced.');
@@ -797,7 +796,7 @@ class UpdateMachine {
797796
default:
798797
assert(debugLog('Error polling event queue for $store: $e\n'
799798
'Backing off and retrying even though may be hopeless…'));
800-
// TODO tell user on non-transient error in polling
799+
reportErrorToUserBriefly('Error loading server data, will retry: $e');
801800
await backoffMachine.wait();
802801
assert(debugLog('… Backoff wait complete, retrying poll.'));
803802
continue;

0 commit comments

Comments
 (0)