Skip to content

Commit d5bd27e

Browse files
committed
Merge branch 'master' of github.com:realm/realm-core into next-major
2 parents ac22a23 + 3334d38 commit d5bd27e

File tree

23 files changed

+265
-142
lines changed

23 files changed

+265
-142
lines changed

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
///

src/realm/sync/config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ enum class SyncClientHookEvent {
134134
BindMessageSent,
135135
ClientResetMergeComplete,
136136
BootstrapBatchAboutToProcess,
137+
UploadMessageSent,
137138
};
138139

139140
enum class SyncClientHookAction {

0 commit comments

Comments
 (0)