File tree 3 files changed +12
-0
lines changed
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 @@ -794,6 +794,7 @@ class UpdateMachine {
794
794
switch (e) {
795
795
case ZulipApiException (code: 'BAD_EVENT_QUEUE_ID' ):
796
796
assert (debugLog ('Lost event queue for $store . Replacing…' ));
797
+ reportErrorToUserBriefly (localizations.errorReconnectingToServer (serverUrl));
797
798
await store._globalStore._reloadPerAccount (store.accountId);
798
799
dispose ();
799
800
debugLog ('… Event queue replaced.' );
Original file line number Diff line number Diff line change @@ -407,6 +407,9 @@ void main() {
407
407
}
408
408
409
409
test ('handles expired queue' , () => awaitFakeAsync ((async ) async {
410
+ reportErrorToUserBriefly = logAndReportErrorToUserBriefly;
411
+ addTearDown (() => reportErrorToUserBriefly = defaultReportErrorToUserBriefly);
412
+
410
413
await prepareStore ();
411
414
updateMachine.debugPauseLoop ();
412
415
updateMachine.poll ();
@@ -420,7 +423,10 @@ void main() {
420
423
});
421
424
updateMachine.debugAdvanceLoop ();
422
425
async .flushMicrotasks ();
426
+ check (lastReportedError).isNull ();
423
427
await Future <void >.delayed (Duration .zero);
428
+ check (takeLastReportedError ()).isNotNull ()
429
+ .contains ('Reconnecting to ${eg .realmUrl .origin }…' );
424
430
check (store).isLoading.isTrue ();
425
431
426
432
// The global store has a new store.
You can’t perform that action at this time.
0 commit comments