Skip to content

Commit 3833b78

Browse files
committed
Merge tag 'v14.11.0' into next-major
2 parents 18e5d20 + 6086784 commit 3833b78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2443
-391
lines changed

CHANGELOG.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,39 @@
2121

2222
----------------------------------------------
2323

24-
# 14.10.4 Release notes
24+
# 14.11.0 Release notes
2525

2626
### Enhancements
27+
* On Windows devices Device Sync will additionally look up SSL certificates in the Windows Trusted Root Certification Authorities certificate store when establishing a connection. (PR [#7882](https://github.com/realm/realm-core/pull/7882))
28+
* Updated the return type of `LogCategory::get_category_names()` from `std::vector<const char*>` to `std::vector<std::string_view>`. ([PR #7879](https://github.com/realm/realm-core/pull/7879))
29+
* Added `realm_get_persisted_schema_version` for reading the version of the schema currently stored locally. (PR [#7873](https://github.com/realm/realm-core/pull/7873))
30+
* Added `realm_app_config_get_sync_client_config()` function to the C_API to get the sync_client_config value in `realm_app_config_t` if REALM_APP_SERVICES is enabled. If REALM_APP_SERVICES is not available, `realm_sync_client_config_new()` is available to create a new `sync_client_config_t` to use when initializing the sync manager. ([PR #7891](https://github.com/realm/realm-core/pull/7891))
31+
* Role and permissions changes no longer require a client reset to update the local realm. ([PR #7440](https://github.com/realm/realm-core/pull/7440))
32+
33+
### Fixed
34+
* FLX download progress was only updated when bootstraps completed, making it always be 0 before the first completion and then forever 1. ([PR #7869](https://github.com/realm/realm-core/issues/7869), since v14.10.2)
35+
* Sync client can crash if a session is resumed while the session is being suspended. ([#7860](https://github.com/realm/realm-core/issues/7860), since v12.0.0)
36+
* If a sync session is interrupted by a disconnect or restart while downloading a bootstrap, stale data from the previous bootstrap may be included when the session reconnects and downloads the bootstrap. This can lead to objects stored in the database that do not match the actual state of the server and potentially leading to compensating writes. ([#7827](https://github.com/realm/realm-core/issues/7827), since v12.0.0)
37+
* Fixed unnecessary server roundtrips when there is no download to acknowledge ([#2129](https://jira.mongodb.org/browse/RCORE-2129), since v14.8.0).
38+
39+
### Breaking changes
2740
* None.
2841

42+
### Compatibility
43+
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier.
44+
45+
-----------
46+
47+
### Internals
48+
* Protocol version has been updated to v14 to support server intiated bootstraps and role change updates without a client reset. ([PR #7440](https://github.com/realm/realm-core/pull/7440))
49+
* Add support for server initiated bootstraps. ([PR #7440](https://github.com/realm/realm-core/pull/7440))
50+
51+
----------------------------------------------
52+
53+
# 14.10.4 Release notes
54+
55+
### Enhancements
56+
2957
### Fixed
3058
* When a public name is defined on a property, calling `realm::Results::sort()` or `realm::Results::distinct()` with the internal name could throw an error like `Cannot sort on key path 'NAME': property 'PersonObject.NAME' does not exist`. ([realm/realm-js#6779](https://github.com/realm/realm-js/issues/6779), since v12.12.0)
3159

@@ -45,14 +73,14 @@
4573
# 14.10.3 Release notes
4674

4775
### Enhancements
48-
* "Next launch" metadata file actions are now performed in a multi-process safe manner ([#7576](https://github.com/realm/realm-core/pull/7576)).
76+
* "Next launch" metadata file actions are now performed in a multi-process safe manner. ([PR #7576](https://github.com/realm/realm-core/pull/7576))
4977

5078
### Fixed
5179
* Fixed a change of mode from Strong to All when removing links from an embedded object that links to a tombstone. This affects sync apps that use embedded objects which have a `Lst<Mixed>` that contains a link to another top level object which has been deleted by another sync client (creating a tombstone locally). In this particular case, the switch would cause any remaining link removals to recursively delete the destination object if there were no other links to it. ([#7828](https://github.com/realm/realm-core/issues/7828), since 14.0.0-beta.0)
5280
* Fixed removing backlinks from the wrong objects if the link came from a nested list, nested dictionary, top-level dictionary, or list of mixed, and the source table had more than 256 objects. This could manifest as `array_backlink.cpp:112: Assertion failed: int64_t(value >> 1) == key.value` when removing an object. ([#7594](https://github.com/realm/realm-core/issues/7594), since v11 for dictionaries)
5381
* Fixed the collapse/rejoin of clusters which contained nested collections with links. This could manifest as `array.cpp:319: Array::move() Assertion failed: begin <= end [2, 1]` when removing an object. ([#7839](https://github.com/realm/realm-core/issues/7839), since the introduction of nested collections in v14.0.0-beta.0)
5482
* wait_for_upload_completion() was inconsistent in how it handled commits which did not produce any changesets to upload. Previously it would sometimes complete immediately if all commits waiting to be uploaded were empty, and at other times it would wait for a server roundtrip. It will now always complete immediately. ([PR #7796](https://github.com/realm/realm-core/pull/7796)).
55-
* `realm_sync_session_handle_error_for_testing` parameter `is_fatal` was flipped changing the expected behavior. (#[7750](https://github.com/realm/realm-core/issues/7750)).
83+
* `realm_sync_session_handle_error_for_testing` parameter `is_fatal` was flipped changing the expected behavior. ([#7750](https://github.com/realm/realm-core/issues/7750))
5684

5785
### Breaking changes
5886
* None.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import PackageDescription
44
import Foundation
55

6-
let versionStr = "14.10.4"
6+
let versionStr = "14.11.0"
77
let versionPieces = versionStr.split(separator: "-")
88
let versionCompontents = versionPieces[0].split(separator: ".")
99
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""

dependencies.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
PACKAGE_NAME: realm-core
2-
VERSION: 14.10.4
2+
VERSION: 14.11.0
33
OPENSSL_VERSION: 3.2.0
44
ZLIB_VERSION: 1.2.13
55
# https://github.com/10gen/baas/commits
66
# 2f308db is 2024 July 10
77
BAAS_VERSION: 2f308db6f65333728a101d1fecbb792f9659a5ce
8+
BAAS_VERSION_TYPE: githash

evergreen/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,9 @@ functions:
242242
shell: bash
243243
env:
244244
BAASAAS_API_KEY: "${baasaas_api_key}"
245+
# BAAS_VERSION and VERSION_TYPE are set by realm-core/dependencies.yml
245246
BAASAAS_REF_SPEC: "${BAAS_VERSION}"
246-
BAASAAS_START_MODE: "githash"
247+
BAASAAS_START_MODE: "${BAAS_VERSION_TYPE|githash}"
247248
script: |-
248249
set -o errexit
249250
set -o verbose

src/realm.h

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,11 @@ RLM_API realm_schema_t* realm_get_schema(const realm_t*);
12411241
*/
12421242
RLM_API uint64_t realm_get_schema_version(const realm_t* realm);
12431243

1244+
/**
1245+
* Get the schema version for this realm at the path.
1246+
*/
1247+
RLM_API uint64_t realm_get_persisted_schema_version(const realm_config_t* config);
1248+
12441249
/**
12451250
* Update the schema of an open realm.
12461251
*
@@ -3018,8 +3023,6 @@ RLM_API void realm_app_config_set_metadata_mode(realm_app_config_t*,
30183023
RLM_API void realm_app_config_set_metadata_encryption_key(realm_app_config_t*, const uint8_t[64]) RLM_API_NOEXCEPT;
30193024
RLM_API void realm_app_config_set_security_access_group(realm_app_config_t*, const char*) RLM_API_NOEXCEPT;
30203025

3021-
RLM_API realm_sync_client_config_t* realm_app_config_get_sync_client_config(realm_app_config_t*) RLM_API_NOEXCEPT;
3022-
30233026
/**
30243027
* Get an existing @a realm_app_credentials_t and return it's json representation
30253028
* Note: the caller must delete the pointer to the string via realm_release
@@ -3741,8 +3744,21 @@ typedef void (*realm_async_open_task_completion_func_t)(realm_userdata_t userdat
37413744
// callback runs.
37423745
typedef void (*realm_async_open_task_init_subscription_func_t)(realm_thread_safe_reference_t* realm,
37433746
realm_userdata_t userdata);
3744-
3747+
#if REALM_APP_SERVICES
3748+
// If using App Services, the realm_sync_client_config_t instance is part of the
3749+
// realm_app_config_t structure and this function returns a pointer to that
3750+
// member property. The realm_sync_client_config_t reference returned by this
3751+
// function should not be freed using realm_release.
3752+
RLM_API realm_sync_client_config_t* realm_app_config_get_sync_client_config(realm_app_config_t*) RLM_API_NOEXCEPT;
3753+
#else
3754+
// If not using App Services, the realm_app_config_t structure is not defined, and
3755+
// the real_sync_client_config_t structure returned by this function is meant to be
3756+
// used with realm_sync_manager_create() to create a separate Sync Manager instance.
3757+
// The realm_sync_client_config_t instance returned by this function will need to be
3758+
// manually freed using realm_release.
37453759
RLM_API realm_sync_client_config_t* realm_sync_client_config_new(void) RLM_API_NOEXCEPT;
3760+
#endif // REALM_APP_SERVICES
3761+
37463762
RLM_API void realm_sync_client_config_set_reconnect_mode(realm_sync_client_config_t*,
37473763
realm_sync_client_reconnect_mode_e) RLM_API_NOEXCEPT;
37483764
RLM_API void realm_sync_client_config_set_multiplex_sessions(realm_sync_client_config_t*, bool) RLM_API_NOEXCEPT;

src/realm/object-store/c_api/app.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ RLM_API const char* realm_app_credentials_serialize_as_json(realm_app_credential
279279
});
280280
}
281281

282+
RLM_API realm_sync_client_config_t* realm_app_config_get_sync_client_config(realm_app_config_t* app_config) noexcept
283+
{
284+
return static_cast<realm_sync_client_config_t*>(&app_config->sync_client_config);
285+
}
286+
282287
RLM_API realm_app_t* realm_app_create(const realm_app_config_t* app_config)
283288
{
284289
return wrap_err([&] {

src/realm/object-store/c_api/logging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ RLM_API size_t realm_get_category_names(size_t num_values, const char** out_valu
9191
if (number_to_copy > num_values)
9292
number_to_copy = num_values;
9393
for (size_t n = 0; n < number_to_copy; n++) {
94-
out_values[n] = vec[n];
94+
out_values[n] = vec[n].data();
9595
}
9696
}
9797
return number_to_copy;

src/realm/object-store/c_api/schema.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,23 @@ RLM_API uint64_t realm_get_schema_version(const realm_t* realm)
5555
return rlm->schema_version();
5656
}
5757

58+
RLM_API uint64_t realm_get_persisted_schema_version(const realm_config_t* config)
59+
{
60+
auto conf = RealmConfig();
61+
conf.schema_version = ObjectStore::NotVersioned;
62+
conf.path = config->path;
63+
conf.encryption_key = config->encryption_key;
64+
65+
if (config->sync_config) {
66+
conf.sync_config = nullptr;
67+
conf.force_sync_history = true;
68+
}
69+
70+
auto realm = Realm::get_shared_realm(conf);
71+
uint64_t version = ObjectStore::get_schema_version(realm->read_group());
72+
return version;
73+
}
74+
5875
RLM_API bool realm_schema_validate(const realm_schema_t* schema, uint64_t validation_mode)
5976
{
6077
return wrap_err([&]() {

src/realm/object-store/c_api/sync.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ static Query add_ordering_to_realm_query(Query realm_query, const DescriptorOrde
128128
return realm_query;
129129
}
130130

131+
#if !REALM_APP_SERVICES
131132
RLM_API realm_sync_client_config_t* realm_sync_client_config_new(void) noexcept
132133
{
133134
return new realm_sync_client_config_t;
134135
}
136+
#endif // !REALM_APP_SERVICES
135137

136138
RLM_API void realm_sync_client_config_set_reconnect_mode(realm_sync_client_config_t* config,
137139
realm_sync_client_reconnect_mode_e mode) noexcept

src/realm/object-store/c_api/types.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,21 @@ struct realm_http_transport : realm::c_api::WrapC, std::shared_ptr<realm::app::G
617617
}
618618
};
619619

620+
#if REALM_APP_SERVICES
621+
// This class doesn't support realm_release() since it is only meant to be used
622+
// as a CAPI-compatible reference to the SyncClientConfig member variable that
623+
// is part of AppConfig.
624+
// To avoid data misalignment or other conflicts with the original SyncClientConfig,
625+
// do not add any additional functions or member variables to this class.
626+
struct realm_sync_client_config final : realm::SyncClientConfig {
627+
using SyncClientConfig::SyncClientConfig;
628+
};
629+
#else
630+
// This class must be freed using realm_release()
620631
struct realm_sync_client_config : realm::c_api::WrapC, realm::SyncClientConfig {
621632
using SyncClientConfig::SyncClientConfig;
622633
};
634+
#endif // REALM_APP_SERVICES
623635

624636
struct realm_sync_config : realm::c_api::WrapC, realm::SyncConfig {
625637
using SyncConfig::SyncConfig;

0 commit comments

Comments
 (0)