Class DiscardLocalResetHandler
A client reset strategy where all the not yet synchronized data is automatically discarded and a fresh copy of the synchronized Realm is obtained.
Namespace: Realms.Sync.ErrorHandling
Assembly: Realm.dll
Syntax
[Obsolete("Use DiscardUnsyncedChangesHandler instead.")]
public sealed class DiscardLocalResetHandler : ClientResetHandlerBase
Remarks
The freshly downloaded copy of the synchronized Realm triggers all change notifications as a write transaction is internally simulated. This strategy supplies three callbacks: OnBeforeReset, OnAfterReset, and ManualResetFallback. The first two are invoked just before and after the client reset has happened, while the last one will be invoked in case an error occurs during the automated process and the system needs to fallback to a manual mode. The overall recommendation for using this strategy is that using the three available callbacks should only be considered when:
- the user needs to be notified (in OnBeforeReset) of an incoming potential data loss of unsynced data
- the user needs to be notified (in OnAfterReset) that the reset process has completed
- advanced use cases for data-sensitive applications where the developer wants to recover in the most appropriate way the unsynced data
- backup the whole realm before the client reset happens (in OnBeforeReset). Such backup could, for example, be used to restore the unsynced data (see 3.)
Properties
| Improve this Doc View SourceManualResetFallback
Gets or sets the callback triggered when an error has occurred that makes the operation unable to complete, for example in the case of a destructive schema change.
Declaration
public ClientResetHandlerBase.ClientResetCallback ManualResetFallback { get; set; }
Property Value
Type | Description |
---|---|
ClientResetHandlerBase.ClientResetCallback | Callback invoked if automatic Client Reset handling fails. |
OnAfterReset
Gets or sets the callback that indicates a Client Reset just happened.
Declaration
public ClientResetHandlerBase.AfterResetCallback OnAfterReset { get; set; }
Property Value
Type | Description |
---|---|
ClientResetHandlerBase.AfterResetCallback | Callback invoked right after a Client Reset. |
OnBeforeReset
Gets or sets the callback that indicates a Client Reset is about to happen.
Declaration
public ClientResetHandlerBase.BeforeResetCallback OnBeforeReset { get; set; }
Property Value
Type | Description |
---|---|
ClientResetHandlerBase.BeforeResetCallback | Callback invoked right before a Client Reset. |