-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add support for client resync * Changelog + tests
- Loading branch information
Showing
13 changed files
with
260 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Realms.Sync.Exceptions; | ||
|
||
namespace Realms.Sync | ||
{ | ||
/// <summary> | ||
/// Enum describing what should happen in case of a Client Resync. | ||
/// </summary> | ||
/// <remarks> | ||
/// A Client Resync is triggered if the device and server cannot agree on a common shared history | ||
/// for the Realm file, thus making it impossible for the device to upload or receive any changes. | ||
/// This can happen if the server is rolled back or restored from backup. | ||
/// <br/> | ||
/// IMPORTANT: Just having the device offline will not trigger a Client Resync. | ||
/// </remarks> | ||
public enum ClientResyncMode : byte | ||
{ | ||
/// <summary> | ||
/// Realm will compare the local Realm with the Realm on the server and automatically transfer | ||
/// any changes from the local Realm that makes sense to the Realm provided by the server. | ||
/// <br/> | ||
/// This is the default mode for fully synchronized Realms. It is not yet supported by | ||
/// Query-based Realms. | ||
/// </summary> | ||
RecoverLocalRealm = 0, | ||
|
||
/// <summary> | ||
/// The local Realm will be discarded and replaced with the server side Realm. | ||
/// All local changes will be lost. | ||
/// <br/> | ||
/// This mode is not yet supported by Query-based Realms. | ||
/// </summary> | ||
DiscardLocalRealm = 1, | ||
|
||
/// <summary> | ||
/// A manual Client Resync is also known as a Client Reset. | ||
/// <br/> | ||
/// A <see cref="ClientResetException"/> will be sent to <see cref="Session.Error"/>, | ||
/// triggering a Client Reset. Doing this provides a handle to both the old and new Realm file, enabling | ||
/// full control over which changes to move, if any. | ||
/// <br/> | ||
/// This is the only supported mode for Query-based Realms. | ||
/// </summary> | ||
Manual = 2, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
REALM_CORE_VERSION=5.23.1 | ||
REALM_SYNC_VERSION=4.7.1 | ||
REALM_CORE_VERSION=5.23.3 | ||
REALM_SYNC_VERSION=4.7.5 | ||
ANDROID_OPENSSL_VERSION=1.0.2k |
Submodule object-store
updated
30 files
+54 −81 | CMake/RealmCore.cmake | |
+3 −0 | CMake/Sanitizers.cmake | |
+3 −3 | Dockerfile | |
+6 −6 | Jenkinsfile | |
+2 −2 | dependencies.list | |
+2 −3 | src/CMakeLists.txt | |
+4 −4 | src/impl/apple/external_commit_helper.cpp | |
+1 −1 | src/impl/epoll/external_commit_helper.cpp | |
+3 −3 | src/impl/realm_coordinator.cpp | |
+1 −1 | src/impl/realm_coordinator.hpp | |
+2 −1 | src/server/adapter.hpp | |
+1 −2 | src/server/admin_realm.cpp | |
+2 −1 | src/shared_realm.cpp | |
+8 −3 | src/sync/partial_sync.cpp | |
+20 −10 | src/sync/sync_config.hpp | |
+2 −2 | src/sync/sync_manager.cpp | |
+1 −1 | src/sync/sync_manager.hpp | |
+127 −70 | src/sync/sync_session.cpp | |
+18 −22 | src/sync/sync_session.hpp | |
+0 −79 | src/util/fifo.cpp | |
+0 −40 | src/util/fifo.hpp | |
+9 −0 | tests/realm.cpp | |
+2 −3 | tests/sync/partial_sync.cpp | |
+485 −2 | tests/sync/session/session.cpp | |
+1 −0 | tests/sync/session/session_util.hpp | |
+16 −16 | tests/sync/session/wait_for_completion.cpp | |
+16 −6 | tests/util/test_file.cpp | |
+13 −3 | tests/util/test_file.hpp | |
+5 −2 | workflow/build.sh | |
+9 −1 | workflow/test_coverage.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters