I am using unity with realm 10.7.1 and currently testing my realm controller against server-sided “Realm Sync” outages. To simulate this I am switching sync off and on in the browser.
Is their a strategy/pattern to address the outage scenario? I am asking for preventing data loss.
The behaviour I would favour, should allow continued work with the local realm file and
offer some kind of conflict resolution when sync is up and running again.
I tried different concepts. The outcome was realm forcing the outdated cloud data into the local realm file and thus erasing the gained progress. Or the outcome was getting an empty local realm when fetching it, because the background synchronization was not done yet, because sometimes sync took extra time to re-launch. (Listening to session.error, recording that incidence and insisting on GetInstanceAsync followed by SyncSession.WaitForDownload the next appstart(s)/login(s) could not avoid this!)
Frustratingly, from a user point of view: everything seems to be fine and working, but suddenly on a appstart “like any other” realm’s self-healing process kills the local data and overwrites it with the age-old, pre-sync-outage cloud data!
What should I do? Please, can anyone explain how to handle this scenario?