Skip to content
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

Live Queries subscription updates in Parse-server #4905

Closed
pulkitsapra opened this issue Jul 19, 2018 · 2 comments
Closed

Live Queries subscription updates in Parse-server #4905

pulkitsapra opened this issue Jul 19, 2018 · 2 comments

Comments

@pulkitsapra
Copy link

pulkitsapra commented Jul 19, 2018

let query_add = new Parse.Query("class-name");
let subscription = query_add.subscribe();

subscription.on('update', (obj) => {
   alert('object updated');
});

Is it possible to get subscription alerts for live queries on a single client instead of everyone. I am using the following code to get update alerts for the object 'obj' on class 'class-name'. But the alert message comes on every client( i.e every instance of running app). How can I modify this to notify only the single client

@Eolykab
Copy link

Eolykab commented Aug 3, 2019

I am having a problem with Parse 2.4.0. Getting the below error with the above code.
core.js:15724 ERROR TypeError: _this.subscription.on is not a function
at Observable._subscribe (chat.service.ts:47)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe (Observable.js:43)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe (Observable.js:29)
at MessageListPage.push../src/app/pages/message-list/message-list.page.ts.MessageListPage.ionViewDidEnter (message-list.page.ts:50)
at HTMLElement.handler (fesm5.js:3042)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:498)
at invokeTask (zone.js:1744)
at HTMLElement.globalZoneAwareCallback (zone.js:1770)
at lifecycle (chunk-19910bac.js:1)
at fireDidEvents (chunk-19910bac.js:1)
at chunk-19910bac.js:1

@davimacedo
Copy link
Member

Can you please update to the latest versio and check if the problem persists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants