Skip to content

Commit 837a6d0

Browse files
committed
store: Show error message when replacing event queue.
Signed-off-by: Zixuan James Li <[email protected]>
1 parent 3d9b1d3 commit 837a6d0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/model/store.dart

+1
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ class UpdateMachine {
785785
switch (e) {
786786
case ZulipApiException(code: 'BAD_EVENT_QUEUE_ID'):
787787
assert(debugLog('Lost event queue for $store. Replacing…'));
788+
reportErrorToUserBriefly('Reconnecting to server.');
788789
await store._globalStore._reloadPerAccount(store.accountId);
789790
dispose();
790791
debugLog('… Event queue replaced.');

test/model/store_test.dart

+2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,9 @@ void main() {
406406
});
407407
updateMachine.debugAdvanceLoop();
408408
async.flushMicrotasks();
409+
check(debugLastReportedError).isNull();
409410
await Future<void>.delayed(Duration.zero);
411+
check(takeLastReportedError()).isNotNull().contains('Reconnecting to server.');
410412
check(store).isLoading.isTrue();
411413

412414
// The global store has a new store.

0 commit comments

Comments
 (0)