Skip to content

Commit 910f2f4

Browse files
authored
Fixes issue #639 (#640)
* Adds failing test for #639 * Fixes #639
1 parent db59b63 commit 910f2f4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/LiveQuerySubscription.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class Subscription extends EventEmitter {
106106
return CoreManager.getLiveQueryController().getDefaultLiveQueryClient().then((liveQueryClient) => {
107107
liveQueryClient.unsubscribe(this);
108108
this.emit('close');
109-
this.resolve();
110109
});
111110
}
112111
}

src/__tests__/ParseLiveQuery-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jest.dontMock('../promiseUtils');
2020
require('../ParseLiveQuery');
2121
const CoreManager = require('../CoreManager');
2222
const ParseQuery = require('../ParseQuery').default;
23+
const LiveQuerySubscription = require('../LiveQuerySubscription').default;
2324

2425
describe('ParseLiveQuery', () => {
2526
beforeEach(() => {
@@ -182,4 +183,11 @@ describe('ParseLiveQuery', () => {
182183
});
183184

184185
});
186+
187+
it('should not throw on usubscribe', (done) => {
188+
const query = new ParseQuery("ObjectType");
189+
query.equalTo("test", "value");
190+
const subscription = new LiveQuerySubscription('0', query, 'token');
191+
subscription.unsubscribe().then(done).catch(done.fail);
192+
});
185193
});

0 commit comments

Comments
 (0)