DiscardUnsyncedChangesStrategy
Strategy that automatically resolves a Client Reset by discarding any unsynced local data but otherwise keeps the realm open. Any changes will be reported through the normal collection and object notifications.
A synced realm may need to be reset because the Device Sync encountered an error and had to be restored from a backup, or because it has been too long since the client connected to the server so the server has rotated the logs.
The Client Reset thus occurs because the server does not have all the information required to bring the client fully up to date.
The reset process for unsynced changes is as follows: when a client reset is triggered the onBeforeReset callback is invoked, providing an instance of the realm before the reset. Once the reset has concluded, onAfterReset will be invoked with both the instance before (read only) an instance of the final realm (mutable).
In the event that discarding the unsynced data is not enough to resolve the reset the onManualResetFallback callback will be invoked allowing to manually resolve the reset as it would be done in ManuallyRecoverUnsyncedChangesStrategy.onClientReset.
Functions
Callback invoked once the Client Reset happens. It receives two Realm instances: a frozen one displaying the state before the reset and a regular one with the current state that can be used to recover objects from the reset.
Callback that indicates a Client Reset is about to happen. It receives a frozen instance of the realm that will be reset.
Callback that indicates the Client reset failed to complete. It should be handled as in ManuallyRecoverUnsyncedChangesStrategy.onClientReset.