Skip to content

Commit 5112b13

Browse files
committed
Merge branch 'next-major' into feature/string-compression
2 parents 3e8a751 + 3e32e5f commit 5112b13

24 files changed

+294
-143
lines changed

CHANGELOG.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@
2121

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

24+
# 14.10.3 Release notes
25+
26+
### Enhancements
27+
* "Next launch" metadata file actions are now performed in a multi-process safe manner ([#7576](https://github.com/realm/realm-core/pull/7576)).
28+
29+
### Fixed
30+
* 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)
31+
* 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)
32+
* 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)
33+
* 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)).
34+
* `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)).
35+
36+
### Breaking changes
37+
* None.
38+
39+
### Compatibility
40+
* 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.
41+
42+
-----------
43+
44+
### Internals
45+
* Fixed `Table::remove_object_recursive` which wouldn't recursively follow links through a single `Mixed` property. This feature is exposed publicly on `Table` but no SDK currently uses it, so this is considered internal. ([#7829](https://github.com/realm/realm-core/issues/7829), likely since the introduction of Mixed)
46+
* Upload completion is now tracked in a multiprocess-compatible manner ([PR #7796](https://github.com/realm/realm-core/pull/7796)).
47+
* The local realm will assume the the client file ident of the fresh realm during a client reset. ([PR #7850](https://github.com/realm/realm-core/pull/7850))
48+
* Building using C++20 on Windows.
49+
50+
----------------------------------------------
51+
2452
# 14.10.2 Release notes
2553

2654
### Enhancements
@@ -517,7 +545,7 @@
517545
* Fixed equality queries on a Mixed property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. ([6407](https://github.com/realm/realm-core/issues/6407) since v11.0.0-beta.5).
518546
* If you have more than 8388606 links pointing to one specific object, the program will crash. ([#6577](https://github.com/realm/realm-core/issues/6577), since v6.0.0)
519547
* Query for NULL value in Dictionary<Mixed> would give wrong results ([6748])(https://github.com/realm/realm-core/issues/6748), since v10.0.0)
520-
* A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). ([PR #6670](https://github.com/realm/realm-core/pull/6670), since 2.0.0-rc7 for indexes, and since since the introduction of sets in v10.2.0)
548+
* A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). ([PR #6670](https://github.com/realm/realm-core/pull/6670), since 2.0.0-rc7 for indexes, and since the introduction of sets in v10.2.0)
521549

522550
### Breaking changes
523551
* Support for upgrading from Realm files produced by RealmCore v5.23.9 or earlier is no longer supported.

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ if(MSVC)
129129
# We use these in our AtomicSharedPtr implementation and it can't move
130130
# to atomic<shared_ptr<T>> because NotificationToken relies on movability.
131131
add_compile_options(/D_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING)
132+
133+
# Enable __cplusplus macro
134+
add_compile_options(/Zc:__cplusplus)
132135
else()
133136
add_compile_options(-Wall -Wextra -Wempty-body -Wparentheses -Wunknown-pragmas -Wunreachable-code -Wunused-parameter -Wno-missing-field-initializers)
134137
# TODO: Remove this when fixed

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.2"
6+
let versionStr = "14.10.3"
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PACKAGE_NAME: realm-core
2-
VERSION: 14.10.2
2+
VERSION: 14.10.3
33
OPENSSL_VERSION: 3.2.0
44
ZLIB_VERSION: 1.2.13
55
# https://github.com/10gen/baas/commits

evergreen/config.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ functions:
438438
script: |-
439439
if ls crash-*> /dev/null 2>&1; then
440440
echo "Found crash file"
441-
#Rename the crash file and the realm file.
441+
#Rename the crash file and the realm file.
442442
#If there is a crash, this will signal that something needs to be uploaded.
443443
mv crash-* realm-fuzzer-crash.txt
444444
mv fuzz-realm.realm fuzzer_realm.realm
@@ -467,7 +467,7 @@ functions:
467467
bucket: mciuploads
468468
permissions: public-read
469469
content_type: application/x-binary
470-
display_name: Realm File
470+
display_name: Realm File
471471
optional: true
472472

473473
- command: shell.exec
@@ -523,7 +523,7 @@ functions:
523523
set -o verbose
524524
525525
TOP_DIR=$(pwd)
526-
526+
527527
HANG_ANALYZER_PATH=$TOP_DIR/evergreen/hang_analyzer
528528
REQUIREMENTS_PATH=$HANG_ANALYZER_PATH/requirements.txt
529529
@@ -1174,7 +1174,7 @@ tasks:
11741174
./build/test/${cmake_build_type|Debug}-iphonesimulator/realm-combined-tests.app \
11751175
'io.realm.CombinedTests' \
11761176
$TEST_RESULTS_FILE
1177-
1177+
11781178
- name: generate-sync-corpus
11791179
tags: [ "for_nightly_tests" ]
11801180
exec_timeout_secs: 1800
@@ -1401,6 +1401,19 @@ buildvariants:
14011401
- name: compile_test
14021402
- name: lint
14031403

1404+
- name: ubuntu-cpp20
1405+
display_name: "Ubuntu C++20"
1406+
run_on: ubuntu2404-arm64-large
1407+
expansions:
1408+
fetch_missing_dependencies: On
1409+
c_compiler: "/opt/clang+llvm/bin/clang"
1410+
cxx_compiler: "/opt/clang+llvm/bin/clang++"
1411+
clang_format: "/opt/clang+llvm/bin/clang-format"
1412+
extra_flags: -DCMAKE_CXX_STANDARD=20
1413+
tasks:
1414+
- name: compile_test
1415+
- name: lint
1416+
14041417
- name: ubuntu-no-session-multiplexing
14051418
display_name: "Ubuntu (Sync Multiplexing Disabled)"
14061419
run_on: ubuntu2204-arm64-large
@@ -1477,7 +1490,7 @@ buildvariants:
14771490
fetch_missing_dependencies: On
14781491
c_compiler: "/opt/clang+llvm/bin/clang"
14791492
cxx_compiler: "/opt/clang+llvm/bin/clang++"
1480-
run_with_encryption: 1
1493+
run_with_encryption: 1
14811494
enable_asan: On
14821495
cmake_build_type: RelWithDebInfo
14831496
tasks:
@@ -1500,7 +1513,7 @@ buildvariants:
15001513
cxx_compiler: "./clang_binaries/bin/clang++"
15011514
python3: /opt/mongodbtoolchain/v3/bin/python3
15021515
tasks:
1503-
- name: compile_test_and_package
1516+
- name: compile_test_and_package
15041517
- name: benchmarks
15051518
- name: generate-sync-corpus
15061519

@@ -2004,5 +2017,3 @@ buildvariants:
20042017
# no_tests: On
20052018
# tasks:
20062019
# - name: compile_only
2007-
2008-

src/external/bson/bson-decimal128.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ _mul_64x64 (uint64_t left, /* IN */
374374
* Returns:
375375
* The lowercased character.
376376
*/
377-
char
377+
static char
378378
_dec128_tolower (char c)
379379
{
380380
if (isupper (c)) {
@@ -395,7 +395,7 @@ _dec128_tolower (char c)
395395
* Returns:
396396
* true if the strings are equal, false otherwise.
397397
*/
398-
bool
398+
static bool
399399
_dec128_istreq (const char *a, /* IN */
400400
const char *b /* IN */)
401401
{

src/external/bson/bson-iter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ _bson_iter_next_internal (bson_iter_t *iter, /* INOUT */
631631
subtype = *(iter->raw + iter->d2);
632632

633633
if (subtype == BSON_SUBTYPE_BINARY_DEPRECATED) {
634-
int32_t binary_len;
634+
uint32_t binary_len;
635635

636636
if (l < 4) {
637637
iter->err_off = o;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,7 @@ void SyncSession::create_sync_session()
912912
session_config.proxy_config = sync_config.proxy_config;
913913
session_config.simulate_integration_error = sync_config.simulate_integration_error;
914914
session_config.flx_bootstrap_batch_size_bytes = sync_config.flx_bootstrap_batch_size_bytes;
915-
session_config.session_reason =
916-
client_reset::is_fresh_path(m_config.path) ? sync::SessionReason::ClientReset : sync::SessionReason::Sync;
915+
session_config.fresh_realm_download = client_reset::is_fresh_path(m_config.path);
917916
session_config.schema_version = m_config.schema_version;
918917

919918
if (sync_config.on_sync_client_event_hook) {

src/realm/sync/client.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ class SessionWrapper final : public util::AtomicRefCountBase, DB::CommitListener
169169

170170
const SessionReason m_session_reason;
171171

172+
// If false, QUERY and MARK messages are allowed but UPLOAD messages will not
173+
// be sent to the server.
174+
const bool m_allow_upload_messages;
175+
172176
const uint64_t m_schema_version;
173177

174178
std::shared_ptr<SubscriptionStore> m_flx_subscription_store;
@@ -716,6 +720,13 @@ uint64_t SessionImpl::get_schema_version() noexcept
716720
return m_wrapper.m_schema_version;
717721
}
718722

723+
bool SessionImpl::upload_messages_allowed() noexcept
724+
{
725+
// Can only be called if the session is active or being activated
726+
REALM_ASSERT_EX(m_state == State::Active || m_state == State::Unactivated, m_state);
727+
return m_wrapper.m_allow_upload_messages;
728+
}
729+
719730
void SessionImpl::initiate_integrate_changesets(std::uint_fast64_t downloadable_bytes, DownloadBatchState batch_state,
720731
const SyncProgress& progress, const ReceivedChangesets& changesets)
721732
{
@@ -1150,7 +1161,9 @@ SessionWrapper::SessionWrapper(ClientImpl& client, DBRef db, std::shared_ptr<Sub
11501161
, m_progress_handler(std::move(config.progress_handler))
11511162
, m_connection_state_change_listener(std::move(config.connection_state_change_listener))
11521163
, m_debug_hook(std::move(config.on_sync_client_event_hook))
1153-
, m_session_reason(m_client_reset_config ? SessionReason::ClientReset : config.session_reason)
1164+
, m_session_reason(m_client_reset_config || config.fresh_realm_download ? SessionReason::ClientReset
1165+
: SessionReason::Sync)
1166+
, m_allow_upload_messages(!config.fresh_realm_download)
11541167
, m_schema_version(config.schema_version)
11551168
, m_flx_subscription_store(std::move(flx_sub_store))
11561169
, m_migration_store(std::move(migration_store))

src/realm/sync/client.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ class Session {
420420
/// through Client::run().
421421
util::UniqueFunction<ConnectionStateChangeListener> connection_state_change_listener;
422422

423-
/// The purpose of this sync session. Reported to the server for informational purposes and has no functional
424-
/// effect.
425-
SessionReason session_reason = SessionReason::Sync;
423+
/// Is this session being opened for a realm whose path ends in ".fresh"? If so,
424+
/// it will be downloading a fresh copy of the realm data from the server.
425+
bool fresh_realm_download = false;
426426

427427
/// Schema version
428428
///

0 commit comments

Comments
 (0)