-
Notifications
You must be signed in to change notification settings - Fork 577
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
Reset sync session after user custom data update #5875
Comments
@rossicler-hostalky Thank you for your suggestion/feature request. Restarting the sync session is a bit of an expensive operation. A better solution might be that the ADS server to signal to the client that the permissions have the custom user data should be refreshed - and bubble it through to the app. |
@kneth That makes a lot more sense, having that would be great. Right now I have to use the "workaround" of pausing and resuming the sync session, so having the permissions automatically updated without needing to restart the sync session would be a huge improvement. |
@kneth @rossicler-hostalky We have exactly same scenario, currently calling pause/resume as workaround as well after updating custom user data that a role depends on, possible duplicate of this issue. But there is a really critical scenario when a new user logs in, then pause/resume does not help. If we restart app then sync works correctly for this new user when updating custom user data, added this other issue. Tried calling const newUser = await app.logIn(credentials);
app.switchUser(newUser); But we noticed that we still have 2 users on Is there any known workaround to restart the sync session when new user logs in? |
@ampopdev did you find any solution i am facing the same issue |
Problem
When you update a user custom data field that affects a user role permission(s), it doesn't take effect in their permission until realm sync is closed and started again, even if user.refreshCustomData is called.
Solution
One possible solution is to automatically restart the sync session if a user custom data field used in a role permission is updated.
Alternatives
If the solution above is not possible, add a method like "realm.syncSession.restart()" that will preserve all subscriptions to that synced session, but will close and start the session. I know that calling "pause" and "resume" will achieve the same thing, but "resume" doesn't give the idea of starting a new sync session, so it might confuse people (as it did with me).
Sorry if any of my understanding of this is wrong, please correct me if it's the case.
How important is this improvement for you?
I would like to have it but have a workaround
Feature would mainly be used with
Atlas Device Sync
The text was updated successfully, but these errors were encountered: