File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 172
172
"error": {"type": "String", "example": "Invalid format"}
173
173
}
174
174
},
175
+ "errorReconnectingToServer": "Reconnecting to {serverUrl}…",
176
+ "@errorReconnectingToServer": {
177
+ "serverUrl": {"type": "String", "example": "http://example.com/"},
178
+ "description": "Message when reconnecting to the server."
179
+ },
175
180
"errorSharingFailed": "Sharing failed",
176
181
"@errorSharingFailed": {
177
182
"description": "Error message when sharing a message failed."
Original file line number Diff line number Diff line change @@ -959,6 +959,7 @@ class UpdateMachine {
959
959
switch (e) {
960
960
case ZulipApiException (code: 'BAD_EVENT_QUEUE_ID' ):
961
961
assert (debugLog ('Lost event queue for $store . Replacing…' ));
962
+ reportErrorToUserBriefly (localizations.errorReconnectingToServer (serverUrl));
962
963
// This disposes the store, which disposes this update machine.
963
964
await store._globalStore._reloadPerAccount (store.accountId);
964
965
debugLog ('… Event queue replaced.' );
Original file line number Diff line number Diff line change @@ -561,6 +561,9 @@ void main() {
561
561
}
562
562
563
563
test ('handles expired queue' , () => awaitFakeAsync ((async ) async {
564
+ reportErrorToUserBriefly = logAndReportErrorToUserBriefly;
565
+ addTearDown (() => reportErrorToUserBriefly = defaultReportErrorToUserBriefly);
566
+
564
567
await prepareStore ();
565
568
updateMachine.debugPauseLoop ();
566
569
updateMachine.poll ();
@@ -574,7 +577,10 @@ void main() {
574
577
});
575
578
updateMachine.debugAdvanceLoop ();
576
579
async .flushMicrotasks ();
580
+ check (lastReportedError).isNull ();
577
581
await Future <void >.delayed (Duration .zero);
582
+ check (takeLastReportedError ()).isNotNull ()
583
+ .contains ('Reconnecting to ${eg .realmUrl .origin }…' );
578
584
check (store).isLoading.isTrue ();
579
585
580
586
// The global store has a new store.
You can’t perform that action at this time.
0 commit comments