LiveQuery and Role changes

I have Recipe records. Access to them is controlled by 2 roles: A and B. In my app (iOS, using ParseSwift 1.2), I have a liveQuery on all Recipes, which works fine when I touch items in the dashboard.

My problem and question: if I add the currentUser to role B, I was expecting to see Recipe with that role triggering the entered event. But it isn’t the case. When I run the query after the role change (not as a LiveQuery) it is returning all recipes (for role A and B). I am also not seeing the left event being triggered if the user is removed from the role.

I’m trying to see if this is the expected behavior. Am I doing something wrong?

LQ will only fire when the object itself is updated. It doesn’t listen for pointers or relations as that requires additional database operations, which can cause bottlenecks.

As the Recipe isn’t directly mutated here, no LQ will be fired. I believe this is related to #5839, i’ll work on it.

Sounds good! It won’t be blocking my use case, as this role change will be following a user’s action. I should be able to launch a query to fetch the new records.

Have you tried having a seperate LQ to listen to the role class and then re-fetch Recipe on role update? :blush:

That’s a good idea but the client isn’t aware of the role names ahead of times as the roles are generated for each library.