Interface SyncSession.ClientResetHandler
이 페이지의 내용
io.realm.mongodb.sync
구현된 인터페이스:
클래스를 둘러싸는 경우:
Callback for the specific error event known as a Client Reset, determined by the error code ErrorCode.CLIENT_RESET .
A synced Realm may need to be reset because the MongoDB Realm Server encountered an error and had to be restored from a backup or because it has been too long since the client connected to the server so the server has rotated the logs.
따라서 클라이언트 재설정이 발생하는 이유는 서버에 클라이언트를 최신 상태로 유지하는 데 필요한 전체 정보가 없기 때문입니다.
The reset process is as follows: the local copy of the Realm is copied into a recovery directory for safekeeping, and then deleted from the original location. The next time the Realm for that URL is opened, the Realm will automatically be re-downloaded from MongoDB Realm, and can be used as normal.
Data written to the Realm after the local copy of the Realm diverged from the backup remote copy will be present in the local recovery copy of the Realm file. The re-downloaded Realm will initially contain only the data present at the time the Realm was backed up on the server.
The client reset process can be initiated in one of two ways:
Run ClientResetRequiredError.executeClientReset() manually. All Realm instances must be closed before this method is called.
If Client Reset isn't executed manually, it will automatically be carried out the next time all Realm instances have been closed and re-opened. This will most likely be when the app is restarted.
WARNING: Any writes to the Realm file between this callback and Client Reset has been executed, will not be synchronized to MongoDB Realm. Those changes will only be present in the backed up file. It is therefore recommended to close all open Realm instances as soon as possible.