Search Results for

    Show / Hide Table of Contents

    Class RecoverUnsyncedChangesHandler

    A client reset strategy that attempts to automatically recover any unsynchronized changes.

    Inheritance
    Object
    ClientResetHandlerBase
    RecoverUnsyncedChangesHandler
    Namespace: Realms.Sync.ErrorHandling
    Assembly: Realm.dll
    Syntax
    public sealed class RecoverUnsyncedChangesHandler : ClientResetHandlerBase
    Remarks

    You can read more about the automatic merge rules at Client Resets - .NET SDK. The automatic recovery mechanism creates write transactions meaning that all the changes that take place are properly propagated through the standard Realm's change notifications. The RecoverUnsyncedChangesHandler 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 is 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:

    1. The user needs to be notified (in OnBeforeReset) of an incoming potential data loss of unsynced data as a result of a merge or a complete discard of local changes
    2. The user needs to be notified (in OnAfterReset) that the reset process has completed
    3. Advanced use cases for data-sensitive applications where the developer wants to recover in the most appropriate way the unsynced data
    4. 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 Source

    ManualResetFallback

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    See Also

    Client Resets - .NET SDK
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2020 Realm
    Generated by DocFX