Force sync session client reset error

Hello,

I would like to know if it is possible to “force” a client reset error after changing server permissions values.

I have a use case where, at some point, an Atlas function is called and changes some values in user custom data. Those values are used by server read/write permissions. So, as it should be, after changing those user custom data values, any objects created on device will be rejected by the server due to changing the permissions.

I tried realmUser.refreshCustomData() but nothing changed.

My question: is there anything I can do to generate a client reset error (or other session update mechanism) where I can handle this permission change? I wouldn’t like to ask the user to restart the app to update the sync session.

Thank you!

Are you using flexible sync or partition-based sync? For flexible sync, it should happen automatically (with a short delay) and trigger a client reset.

Flexible sync. But it doesn’t trigger. Only after a restart.

I will investigate further and come back if I can’t make it work.

P.S. But even if the client reset is triggered, all realms instances must be nil in order to handle the reset process, right? I think I will have an issue here, also.

Hi, sorry, following back up here. Let me know if this is still an issue? When you make a change to your permissions we will have all clients will get notified of that within 15 minutes when they refresh their permissions, but you are right that I think this should be more automatic and this is an easy change for us so I will file something now and hopefully it will get fixed soon.

Thanks
Tyler

Hi Tyler,

Great, hope that the change will fit my use case where an immediate client reset is required after the custom data is modified.

I am working on an app where multiple companies can be managed. And I store in user’s custom data the UUID of the current working company.

When the user selects the working company the custom data is updated and I would need to download only the data belonging to that company. So if a client reset is triggered right away, it will allow to refresh the realm data.

I hope I was able to make myself clear.

Horatiu