realm-kotlin
realm-kotlin copied to clipboard
Client Reset - automatic recover
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
RecoverOrDiscardUnsycedChangesto avoid breaking changes? Ask other SDKs about this.
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.
Replaced by https://github.com/realm/realm-kotlin/pull/979