diff --git a/CHANGELOG.md b/CHANGELOG.md index 766f9234c5..3ea7e5a31b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Fixed an error "Invalid schema change (UPLOAD): cannot process AddColumn instruction for non-existent table" when using automatic client reset with recovery in dev mode to recover schema changes made locally while offline. ([realm/realm-core#7042](https://github.com/realm/realm-core/pull/7042)) * When place an embedded object would create a new object and keep the original object too. ([#6239](https://github.com/realm/realm-js/issues/6239), since v12.0.0) * When setting an embedded object in a `Realm.List` by index, the new object would be inserted at the end rather than replacing the existing object at the given index. ([#6239](https://github.com/realm/realm-js/issues/6239), since v12.0.0) +* When `SyncConfiguration.clientReset` was `undefined`, no client reset mode was set which could lead to an app crash with the message `m_mode != ClientResyncMode::Manual`. The default mode is now `RecoverUnsyncedChanges` and no callbacks are defined. ([#6260](https://github.com/realm/realm-js/issues/6260), since v12.0.0) ### Compatibility * React Native >= v0.71.4 diff --git a/packages/realm/src/app-services/SyncConfiguration.ts b/packages/realm/src/app-services/SyncConfiguration.ts index 134b53455d..37d83091d0 100644 --- a/packages/realm/src/app-services/SyncConfiguration.ts +++ b/packages/realm/src/app-services/SyncConfiguration.ts @@ -366,7 +366,7 @@ function toSSLVerifyCallbackWithListArguments(verifyCallback: SSLVerifyCallback) function parseClientResetConfig(clientReset: ClientResetConfig | undefined, onError: ErrorCallback | undefined) { if (!clientReset) { return { - clientResyncMode: undefined, + clientResyncMode: binding.ClientResetMode.Recover, notifyBeforeClientReset: undefined, notifyAfterClientReset: undefined, errorHandler: onError ? toBindingErrorHandler(onError) : undefined,