RLM 클라이언트 재설정 모드
Objective-C
enum RLMClientResetMode : NSUInteger {}
Swift
@_nonSendable(_assumed) enum RLMClientResetMode : UInt, @unchecked Sendable
클라이언트 재설정 중 파일 동작을 결정합니다.
@see: https://mongodb.com/ko-kr/docs/realm/sync/error-handling/client-resets/
-
백업 원격 복사본에서 분기된 Realm의 로컬 복사본 이후에 Realm에 기록된 데이터는 Realm 파일의 로컬 복구 복사본에 존재합니다. 다시 다운로드한 Realm에는 처음에는 Realm이 서버에 백업된 시점의 데이터만 포함됩니다.
@see: ``rlmSync_clientResetBackedUpRealmPath`` and ``RLMSyncErrorActionToken`` for more information on accessing the recovery directory and error information. The manual client reset mode handler can be set in two places: 1. As an ErrorReportingBlock argument at ``RLMSyncConfiguration.manualClientResetHandler``. 2. As an ErrorReportingBlock in the ``RLMSyncManager.errorHandler`` property. @see: ``RLMSyncManager.errorHandler`` When an ``RLMSyncErrorClientResetError`` is thrown, the following rules determine which block is executed: - If an error reporting block is set in ``.manualClientResetHandler`` and the ``RLMSyncManager.errorHandler``, the ``.manualClientResetHandler`` block will be executed. - If an error reporting block is set in either the ``.manualClientResetHandler`` or the ``RLMSyncManager``, but not both, the single block will execute. - If no block is set in either location, the client reset will not be handled. The application will likely need to be restarted and unsynced local changes may be lost. @note: The ``RLMSyncManager.errorHandler`` is still invoked under all ``RLMSyncError``s *other than* ``RLMSyncErrorClientResetError``. - see: ``RLMSyncError`` for an exhaustive list.
선언
Objective-C
RLMClientResetModeManual = 0
Swift
case manual = 0
-
더 이상 사용되지 않습니다.
RLMClientResetModeDiscardUnsyncedChanges 사용
동기화되지 않은 모든 로컬 변경 사항은 자동으로 삭제되고 로컬 상태는 서버의 가장 최근 상태로 자동 되돌아갑니다. 그런 다음 동기화되지 않은 변경 사항은 클라이언트 재설정 후 콜백 차단에서 복구할 수 있습니다.
If ``RLMClientResetModeDiscardLocal`` is enabled but the client reset operation is unable to complete then the client reset process reverts to manual mode. Example) During a destructive schema change this mode will fail and invoke the manual client reset handler. The RLMClientResetModeDiscardLocal mode supports two client reset callbacks -- ``RLMClientResetBeforeBlock``, ``RLMClientResetAfterBlock`` -- which can be passed as arguments when creating the ``RLMSyncConfiguration``. @see: ``RLMClientResetAfterBlock`` and ``RLMClientResetBeforeBlock``
선언
Objective-C
RLMClientResetModeDiscardLocal = 1
Swift
case discardLocal = 1
-
동기화되지 않은 모든 로컬 변경 사항은 자동으로 삭제되고 로컬 상태는 서버의 가장 최근 상태로 자동 되돌아갑니다. 그런 다음 동기화되지 않은 변경 사항은 클라이언트 재설정 후 콜백 차단에서 복구할 수 있습니다.
If ``RLMClientResetModeDiscardUnsyncedChanges`` is enabled but the client reset operation is unable to complete then the client reset process reverts to manual mode. Example) During a destructive schema change this mode will fail and invoke the manual client reset handler. The RLMClientResetModeDiscardUnsyncedChanges mode supports two client reset callbacks -- ``RLMClientResetBeforeBlock``, ``RLMClientResetAfterBlock`` -- which can be passed as arguments when creating the ``RLMSyncConfiguration``. @see: ``RLMClientResetAfterBlock`` and ``RLMClientResetBeforeBlock``
선언
Objective-C
RLMClientResetModeDiscardUnsyncedChanges = 1
Swift
static var discardUnsyncedChanges: RLMClientResetMode { get }
-
클라이언트 장치는 클라이언트 재설정 후 서버의 최신 상태를 반영하는 영역 영역을 다운로드합니다. 클라이언트 재설정이 발생하기 전의 로컬 변경 사항과 서버 버전을 통합하기 위해 복구 프로세스가 로컬에서 실행됩니다.
The changes are integrated with the following rules: 1. Objects created locally that were not synced before client reset will be integrated. 2. If an object has been deleted on the server, but was modified on the client, the delete takes precedence and the update is discarded 3. If an object was deleted on the client, but not the server, then the client delete instruction is applied. 4. In the case of conflicting updates to the same field, the client update is applied. If the recovery integration fails, the client reset process falls back to ``RLMClientResetModeManual``. The recovery integration will fail if the "Client Recovery" setting is not enabled on the server. Integration may also fail in the event of an incompatible schema change. The RLMClientResetModeRecoverUnsyncedChanges mode supports two client reset callbacks -- ``RLMClientResetBeforeBlock``, ``RLMClientResetAfterBlock`` -- which can be passed as arguments when creating the ``RLMSyncConfiguration``. @see: ``RLMClientResetAfterBlock`` and ``RLMClientResetBeforeBlock``
선언
Objective-C
RLMClientResetModeRecoverUnsyncedChanges = 2
Swift
case recoverUnsyncedChanges = 2
-
클라이언트 장치는 최신 버전의 서버를 반영하는 객체가 있는 영역을 다운로드합니다. 클라이언트 재설정이 발생하기 전의 로컬 변경 사항과 서버 버전을 통합하기 위해 복구 프로세스가 로컬에서 실행됩니다.
The changes are integrated with the following rules: 1. Objects created locally that were not synced before client reset will be integrated. 2. If an object has been deleted on the server, but was modified on the client, the delete takes precedence and the update is discarded 3. If an object was deleted on the client, but not the server, then the client delete instruction is applied. 4. In the case of conflicting updates to the same field, the client update is applied. If the recovery integration fails, the client reset process falls back to ``RLMClientResetModeDiscardUnsyncedChanges``. The recovery integration will fail if the "Client Recovery" setting is not enabled on the server. Integration may also fail in the event of an incompatible schema change. The RLMClientResetModeRecoverOrDiscardUnsyncedChanges mode supports two client reset callbacks -- ``RLMClientResetBeforeBlock``, ``RLMClientResetAfterBlock`` -- which can be passed as arguments when creating the ``RLMSyncConfiguration``. @see: ``RLMClientResetAfterBlock`` and ``RLMClientResetBeforeBlock``
선언
Objective-C
RLMClientResetModeRecoverOrDiscardUnsyncedChanges = 3
Swift
case recoverOrDiscardUnsyncedChanges = 3