Search Results for

    Show / Hide Table of Contents

    Class DiscardUnsyncedChangesHandler

    A client reset strategy where all the not yet synchronized data is automatically discarded and a fresh copy of the synchronized Realm is obtained.

    Inheritance
    Object
    ClientResetHandlerBase
    DiscardUnsyncedChangesHandler
    Namespace: Realms.Sync.ErrorHandling
    Assembly: Realm.dll
    Syntax
    public sealed class DiscardUnsyncedChangesHandler : 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:

    1. the user needs to be notified (in OnBeforeReset) of an incoming potential data loss of unsynced data
    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