realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

Client Reset - automatic recover

Open edualonso opened this issue 3 years ago • 1 comments

Added RecoverUnsycedChangesStrategy and RecoverOrDiscardUnsyncedChangesStrategy and lifted restrictions on strategies depending on the Sync mode.

Similarly to the Java implementation (https://github.com/realm/realm-java/pull/7698) the API for RecoverOrDiscardUnsyncedChangesStrategy has

    public fun onAfterRecovery(before: TypedRealm, after: MutableRealm)
    public fun onAfterDiscard(before: TypedRealm, after: MutableRealm)

instead of the standard onAfter callback.

TODO:

  • [x] decide whether we should change the default strategy to be RecoverOrDiscardUnsycedChanges to avoid breaking changes? Ask other SDKs about this.

edualonso avatar Jul 19 '22 14:07 edualonso

The Core commit must be updated to include a fix the includes https://github.com/realm/realm-core/pull/5726 since one of our new tests client reset integration tests triggers a "231" error which isn't present in the C-API thus crashing the test.

edualonso avatar Aug 09 '22 15:08 edualonso

Replaced by https://github.com/realm/realm-kotlin/pull/979

edualonso avatar Aug 18 '22 19:08 edualonso