Skip to content

Commit

Permalink
Fix: Live Query Subscription Error Event
Browse files Browse the repository at this point in the history
Similar to #1151
  • Loading branch information
dplewis committed Jul 15, 2020
1 parent 75c0095 commit 25ec4c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/LiveQueryClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class LiveQueryClient extends EventEmitter {
if (data.requestId) {
if (subscription) {
subscription.subscribePromise.resolve();
subscription.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR, data.error);
setTimeout(() => subscription.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR, data.error), 200);
}
} else {
this.emit(CLIENT_EMMITER_TYPES.ERROR, data.error);
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/LiveQueryClient-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ describe('LiveQueryClient', () => {

liveQueryClient._handleWebSocketMessage(event);

jest.runOnlyPendingTimers();
expect(isChecked).toBe(true);
});

Expand Down

0 comments on commit 25ec4c3

Please sign in to comment.