Realm C++ SDK Version v2.2.0
Public Member Functions | List of all members

realm::client_reset::recover_unsynced_changes Struct Reference

#include <client_reset.hpp>

Inheritance diagram for realm::client_reset::recover_unsynced_changes:
realm::internal::bridge::client_reset_mode_base< db >

Public Member Functions

 recover_unsynced_changes (std::function< void(db local)> before, std::function< void(db local, db remote)> after)
 

Additional Inherited Members

- Protected Attributes inherited from realm::internal::bridge::client_reset_mode_base< db >
std::function< void(db local)> m_before
 
std::function< void(db local, db remote)> m_after
 
::realm::client_reset_mode m_mode
 

Detailed Description

The client device will download a realm which reflects the latest state of the server after a client reset. A recovery process is run locally in an attempt to integrate the server version with any local changes from before the client reset occurred.

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 behavior falls back to manual mode. 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 documentation for this struct was generated from the following files: