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 @@ -812,6 +812,7 @@ class UpdateMachine {
812
812
switch (e) {
813
813
case ZulipApiException (code: 'BAD_EVENT_QUEUE_ID' ):
814
814
assert (debugLog ('Lost event queue for $store . Replacing…' ));
815
+ reportErrorToUserBriefly (localizations.errorReconnectingToServer (serverUrl));
815
816
await store._globalStore._reloadPerAccount (store.accountId);
816
817
dispose ();
817
818
debugLog ('… Event queue replaced.' );
Original file line number Diff line number Diff line change @@ -412,6 +412,9 @@ void main() {
412
412
}
413
413
414
414
test ('handles expired queue' , () => awaitFakeAsync ((async ) async {
415
+ reportErrorToUserBriefly = logAndReportErrorToUserBriefly;
416
+ addTearDown (() => reportErrorToUserBriefly = defaultReportErrorToUserBriefly);
417
+
415
418
await prepareStore ();
416
419
updateMachine.debugPauseLoop ();
417
420
updateMachine.poll ();
@@ -425,7 +428,10 @@ void main() {
425
428
});
426
429
updateMachine.debugAdvanceLoop ();
427
430
async .flushMicrotasks ();
431
+ check (lastReportedError).isNull ();
428
432
await Future <void >.delayed (Duration .zero);
433
+ check (takeLastReportedError ()).isNotNull ()
434
+ .contains ('Reconnecting to ${eg .realmUrl .origin }…' );
429
435
check (store).isLoading.isTrue ();
430
436
431
437
// The global store has a new store.
You can’t perform that action at this time.
0 commit comments