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 172172 "error": {"type": "String", "example": "Invalid format"}
173173 }
174174 },
175+ "errorReconnectingToServer": "Reconnecting to {serverUrl}…",
176+ "@errorReconnectingToServer": {
177+ "serverUrl": {"type": "String", "example": "http://example.com/"},
178+ "description": "Message when reconnecting to the server."
179+ },
175180 "errorSharingFailed": "Sharing failed",
176181 "@errorSharingFailed": {
177182 "description": "Error message when sharing a message failed."
Original file line number Diff line number Diff line change @@ -812,6 +812,7 @@ class UpdateMachine {
812812 switch (e) {
813813 case ZulipApiException (code: 'BAD_EVENT_QUEUE_ID' ):
814814 assert (debugLog ('Lost event queue for $store . Replacing…' ));
815+ reportErrorToUserBriefly (localizations.errorReconnectingToServer (serverUrl));
815816 await store._globalStore._reloadPerAccount (store.accountId);
816817 dispose ();
817818 debugLog ('… Event queue replaced.' );
Original file line number Diff line number Diff line change @@ -412,6 +412,9 @@ void main() {
412412 }
413413
414414 test ('handles expired queue' , () => awaitFakeAsync ((async ) async {
415+ reportErrorToUserBriefly = logAndReportErrorToUserBriefly;
416+ addTearDown (() => reportErrorToUserBriefly = defaultReportErrorToUserBriefly);
417+
415418 await prepareStore ();
416419 updateMachine.debugPauseLoop ();
417420 updateMachine.poll ();
@@ -425,7 +428,10 @@ void main() {
425428 });
426429 updateMachine.debugAdvanceLoop ();
427430 async .flushMicrotasks ();
431+ check (lastReportedError).isNull ();
428432 await Future <void >.delayed (Duration .zero);
433+ check (takeLastReportedError ()).isNotNull ()
434+ .contains ('Reconnecting to ${eg .realmUrl .origin }…' );
429435 check (store).isLoading.isTrue ();
430436
431437 // The global store has a new store.
You can’t perform that action at this time.
0 commit comments