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, multiple subscription at once, is it me or it's not implemented at the moment? #1767

Closed
avielfedida opened this issue May 12, 2016 · 3 comments

Comments

@avielfedida
Copy link

avielfedida commented May 12, 2016

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.

@benishak
Copy link
Contributor

Why not update your parse to latest version?

@avielfedida
Copy link
Author

avielfedida commented May 12, 2016

@benishak I mistakenly typed unrelated version, I'm using 2.2.9(updated)

@drew-gross
Copy link
Contributor

This sounds like a bug in the Parse JS SDK. Could you re-open over there?

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