Skip to content

Live Queries subscription updates in Parse-server #4905

Closed

Description

@pulkitsapra
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

Activity

  1. Eolykab commented on Aug 3, 2019

    @Eolykab

    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

  2. davimacedo commented on Aug 3, 2019

    @davimacedo
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions