You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces the beginning of a split between sync and app services. Object
store Sync types (almost) don't depend on the `app` namespace, and can be used
independently of it. The SyncUser type now implements only the functionality
required internally for sync, and is backed by a UserProvider interface which
allows it to request things like access token refreshes. All user management
has been removed from SyncManager, and it now only owns the sync client and
active sync sessions. SyncSession is mostly unchanged.
`app::User` is the new equivalent of the old SyncUser type. The user management
which used to be in SyncManager is now in App, which implements the
UserProvider interface.
Metadata storage for sync and App has been completely redesigned. The metadata
store is no longer optional, and instead has an in-memory implementation that
should work identically to the persistent store other than not being
persistent. The interface has been reworked to enable atomic updates to the
metadata store rather than relying on the filesystem mutex in SyncManager,
which will be required for multiprocess sync. This required pushing
significantly more logic into the metadata storage, which fortunately turned
out to also simplify things in the process.
The ownership relationship between `App` and `User` has been inverted, with
`App` now holding a weak cache of users and `User` strongly retaining the
`App`. This ensures that a `SyncConfig` now retains everything it depends on
even when app caching is not used.
Co-authored-by: James Stone <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+18
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
* Audit event scopes containing zero events to save no longer open the audit realm unneccesarily ([PR #7332](https://github.com/realm/realm-core/pull/7332)).
10
10
* Added a method to check if a file needs upgrade. ([#7140](https://github.com/realm/realm-core/issues/7140))
11
11
* Use `clonefile()` when possible in `File::copy()` on Apple platforms for faster copying. ([PR #7341](https://github.com/realm/realm-core/pull/7341)).
12
+
* Introduce the new `SyncUser` interface which can be implemented by SDKs to use sync without the core App Services implementation (or just for greater control over user behavior in tests). ([PR #7300](https://github.com/realm/realm-core/pull/7300).
12
13
13
14
### Fixed
14
15
* Fixed queries like `indexed_property == NONE {x}` which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. ([realm-js #7862](https://github.com/realm/realm-java/issues/7862), since v12.5.0)
@@ -20,9 +21,23 @@
20
21
* Fixed a crash with `Assertion failed: m_initiated` during sync session startup ([#7074](https://github.com/realm/realm-core/issues/7074), since v10.0.0).
21
22
* Fixed a TSAN violation where the user thread could race to read `m_finalized` with the sync event loop ([#6844](https://github.com/realm/realm-core/issues/6844), since v13.15.1)
22
23
* Fix a minor race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. ([PR #7341](https://github.com/realm/realm-core/pull/7341)).
24
+
* SyncUser::all_sessions() included sessions in every state *except* for waiting for access token, which was weirdly inconsistent. It now includes all sessions. ([PR #7300](https://github.com/realm/realm-core/pull/7300).
25
+
* App::all_users() included logged out users only if they were logged out while the App instance existed. It now always includes all logged out users. ([PR #7300](https://github.com/realm/realm-core/pull/7300).
23
26
24
27
### Breaking changes
25
28
* SyncManager no longer supports reconfiguring after calling reset_for_testing(). SyncManager::configure() has been folded into the constructor, and reset_for_testing() has been renamed to tear_down_for_testing(). ([PR #7351](https://github.com/realm/realm-core/pull/7351))
29
+
* The following types have been renamed as part of moving all of the App Services functionality to the app namespace:
30
+
- SyncUser -> app::User. Note that there is a new, different type named SyncUser.
31
+
- SyncUser::identity -> app::User::user_id. The "identity" word was overloaded to mean two unrelated things, and one has been changed to user_id everywhere.
* Some fields have moved from SyncClientConfig to AppConfig. AppConfig now has a SyncClientConfig field rather than it being passed separately to App::get_app(). ([PR #7300](https://github.com/realm/realm-core/pull/7300).
39
+
* Sync user management has been removed from SyncManager. This functionality was already additionally available on App. ([PR #7300](https://github.com/realm/realm-core/pull/7300).
40
+
* Getting sync sessions from a sync user is now done via SyncManager::get_all_sessions_for() rather than SyncUser::all_sessions(). ([PR #7300](https://github.com/realm/realm-core/pull/7300).
26
41
27
42
### Compatibility
28
43
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
@@ -37,6 +52,9 @@
37
52
* The minimum CMake version has changed from 3.15 to 3.22.1. ([#6537](https://github.com/realm/realm-core/issues/6537))
38
53
* Update Catch2 to v3.5.2 ([PR #7297](https://github.com/realm/realm-core/pull/7297)).
39
54
* The unused `partition` and `user_local_uuid()` fields have been removed from `FileActionMetadata`. ([PR #7341](https://github.com/realm/realm-core/pull/7341)).
55
+
* App metadaa storage has been entirely rewritten in preparation for supporting sharing metadata realms between processes.
56
+
* The metadata disabled mode has been replaced with an in-memory metadata mode which performs similarly and doesn't work weirdly differently from the normal mode.
57
+
* The ownership relationship between App and User has changed. User now strongly retains App and App has a weak cache of Users.
0 commit comments