-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Updating a Roles User doesn't fire LQ. #7270
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
Comments
Hi ! The LiveQuery is listening for changes on the User collection, however when the you're adding or removing a user to a role, you are updating a role, not a user. This is why the LiveQuery isn't triggered. To be confirmed, but I think that is not a bug :) |
@percypyan Thanks for the comment, after reading the issue again I agree that this seems more like a proposal for an enhancement than a bug. Or is this even a non-issue, because the LQ trigger should be on the role class, @dblythy? |
Thank you @percypyan and @mtrezza for the thoughts. I think you both might be right. Let me check and I’ll let you know. |
New Issue Checklist
Possibly related: #5839
Issue Description
If a user is listening to LQ events that they have read access to, and the ACL of an existing Parse.Object (that has the className of the LQ) is updated, an LQ event will fire.
However, this isn't the case with roles.
If a user is listening to LQ events that they have read access to, and the ACL's role of an existing Parse.Object (that has the className of the LQ) add are removes a user, objects that are now available to the user won't come through LQ.
Steps to reproduce
Actual Outcome
No LQ event.
Expected Outcome
When a role user is added or removed, Parse should internally query LQ classes for objects with that role name (possibly limited). If objects are found, they should be passed as LQ events to the client, as an
enter
orleave
request."This could be problematic and cause bottlenecks with a few LQ classes.
Alternatives:
beforeSave
on role and maybe the option toParse.Cloud.forceLiveQueryFind(Parse.User, 'className')
, which could force an LQ to.find
all related objects, with a new SDK method:Failing Test Case / Pull Request
Also related: Community discussion
The text was updated successfully, but these errors were encountered: