Skip to content

Live queries, multiple subscription at once, is it me or it's not implemented at the moment? #278

@avielfedida

Description

@avielfedida

Hello everyone, I'm using the JS-SDK(v1.8.4) with Parse-server(v2.2.9), I tried to subscribe to multiple queries at the same app page, I've noticed that for example:

If I subscribe only to Query A, I can later unsubscribe(as in using the method) from Query A and all is good(no further events will emitted), but If I subscribe to Query A, then I again subscribe to Query B, and now I want to unsubscribefrom Query A, I can't, events will still emitted.

If I subscribe to A then B, now I unsubscribe from B, no no further events will emitted for B, but I can't unsubscribe from A, I can call unsubscribe but events for A will emitted.

I don't know if this supposed to work like that(not implemented feature), anyway I just wanted to know if its a valid behavior?, for now the workaround is to delete the event from the subscription object, for example:

let subscription = (new Parse.Query('ObjectName')).subscribe();
subscription.on('create', data => {})
delete subscription ._events.create;

In the A, B case, you could use unsubscribe for B and delete for A.

Update:

To be more specific, if I have multiple queries subscribed to the same class, I can unsubscribe from both of them successfully, so it reduces the problem to a case where I have 2 queries with 2 different classes, if ever implemented?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions