Skip to content

Fixes issue #639 #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/LiveQuerySubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class Subscription extends EventEmitter {
return CoreManager.getLiveQueryController().getDefaultLiveQueryClient().then((liveQueryClient) => {
liveQueryClient.unsubscribe(this);
this.emit('close');
this.resolve();
});
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/__tests__/ParseLiveQuery-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jest.dontMock('../promiseUtils');
require('../ParseLiveQuery');
const CoreManager = require('../CoreManager');
const ParseQuery = require('../ParseQuery').default;
const LiveQuerySubscription = require('../LiveQuerySubscription').default;

describe('ParseLiveQuery', () => {
beforeEach(() => {
Expand Down Expand Up @@ -182,4 +183,11 @@ describe('ParseLiveQuery', () => {
});

});

it('should not throw on usubscribe', (done) => {
const query = new ParseQuery("ObjectType");
query.equalTo("test", "value");
const subscription = new LiveQuerySubscription('0', query, 'token');
subscription.unsubscribe().then(done).catch(done.fail);
});
});