Skip to content

Commit 276a736

Browse files
authored
Add response object to live query (#979)
Let me know if changes are needed
1 parent ebc1081 commit 276a736

File tree

4 files changed

+344
-269
lines changed

4 files changed

+344
-269
lines changed

integration/test/ParseLiveQueryTest.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ describe('Parse LiveQuery', () => {
2020
it('can subscribe to query', async (done) => {
2121
const object = new TestObject();
2222
await object.save();
23+
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();
2324

2425
const query = new Parse.Query(TestObject);
2526
query.equalTo('objectId', object.id);
2627
const subscription = await query.subscribe();
2728

28-
subscription.on('update', object => {
29+
subscription.on('update', (object, original, response) => {
2930
assert.equal(object.get('foo'), 'bar');
31+
assert.equal(response.installationId, installationId);
3032
done();
3133
})
3234
object.set({ foo: 'bar' });
@@ -36,6 +38,7 @@ describe('Parse LiveQuery', () => {
3638
it('can subscribe to query with client', async (done) => {
3739
const object = new TestObject();
3840
await object.save();
41+
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();
3942

4043
const query = new Parse.Query(TestObject);
4144
query.equalTo('objectId', object.id);
@@ -45,8 +48,9 @@ describe('Parse LiveQuery', () => {
4548
}
4649
const subscription = client.subscribe(query);
4750

48-
subscription.on('update', object => {
51+
subscription.on('update', (object, original, response) => {
4952
assert.equal(object.get('foo'), 'bar');
53+
assert.equal(response.installationId, installationId);
5054
done();
5155
});
5256
await subscription.subscribePromise;

0 commit comments

Comments
 (0)