Skip to content

Commit a05d0ae

Browse files
committed
Merge branch 'master' of github.com:realm/realm-core into next-major
2 parents 52d744b + 970e558 commit a05d0ae

File tree

168 files changed

+2401
-1249
lines changed

Some content is hidden

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

168 files changed

+2401
-1249
lines changed

.clang-format

Lines changed: 82 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
# Don't try to format any languages not described by this file
3-
DisableFormat: true
4-
BasedOnStyle: LLVM
2+
Language: Cpp
53
AccessModifierOffset: -4
64
AlignAfterOpenBracket: Align
7-
AlignConsecutiveMacros: false
8-
AlignConsecutiveAssignments: false
9-
AlignConsecutiveDeclarations: false
5+
AlignArrayOfStructures: None
6+
AlignConsecutiveMacros: None
7+
AlignConsecutiveAssignments: None
8+
AlignConsecutiveBitFields: None
9+
AlignConsecutiveDeclarations: None
1010
AlignEscapedNewlines: Right
11-
AlignOperands: true
11+
AlignOperands: Align
1212
AlignTrailingComments: true
1313
AllowAllArgumentsOnNextLine: true
14-
AllowAllConstructorInitializersOnNextLine: true
1514
AllowAllParametersOfDeclarationOnNextLine: true
16-
AllowShortBlocksOnASingleLine: false
15+
AllowShortEnumsOnASingleLine: true
16+
AllowShortBlocksOnASingleLine: Never
1717
AllowShortCaseLabelsOnASingleLine: false
1818
AllowShortFunctionsOnASingleLine: Empty
1919
AllowShortLambdasOnASingleLine: Empty
@@ -23,12 +23,14 @@ AlwaysBreakAfterDefinitionReturnType: None
2323
AlwaysBreakAfterReturnType: None
2424
AlwaysBreakBeforeMultilineStrings: false
2525
AlwaysBreakTemplateDeclarations: Yes
26+
AttributeMacros:
27+
- __capability
2628
BinPackArguments: true
2729
BinPackParameters: true
2830
BraceWrapping:
2931
AfterCaseLabel: false
3032
AfterClass: false
31-
AfterControlStatement: false
33+
AfterControlStatement: Never
3234
AfterEnum: false
3335
AfterFunction: true
3436
AfterNamespace: false
@@ -38,27 +40,39 @@ BraceWrapping:
3840
AfterExternBlock: false
3941
BeforeCatch: true
4042
BeforeElse: true
43+
BeforeLambdaBody: false
44+
BeforeWhile: false
4145
IndentBraces: false
4246
SplitEmptyFunction: true
4347
SplitEmptyRecord: true
4448
SplitEmptyNamespace: true
4549
BreakBeforeBinaryOperators: None
50+
BreakBeforeConceptDeclarations: true
4651
BreakBeforeBraces: Custom
4752
BreakBeforeInheritanceComma: false
4853
BreakInheritanceList: BeforeColon
4954
BreakBeforeTernaryOperators: true
55+
BreakConstructorInitializersBeforeComma: false
5056
BreakConstructorInitializers: BeforeComma
5157
BreakAfterJavaFieldAnnotations: false
5258
BreakStringLiterals: true
5359
ColumnLimit: 118
5460
CommentPragmas: '^ IWYU pragma:'
61+
QualifierAlignment: Leave
5562
CompactNamespaces: false
56-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
5763
ConstructorInitializerIndentWidth: 4
5864
ContinuationIndentWidth: 4
5965
Cpp11BracedListStyle: true
66+
DeriveLineEnding: true
6067
DerivePointerAlignment: false
68+
DisableFormat: false
69+
EmptyLineAfterAccessModifier: Never
70+
EmptyLineBeforeAccessModifier: LogicalBlock
6171
ExperimentalAutoDetectBinPacking: false
72+
PackConstructorInitializers: BinPack
73+
BasedOnStyle: ''
74+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
75+
AllowAllConstructorInitializersOnNextLine: true
6276
FixNamespaceComments: true
6377
ForEachMacros:
6478
- foreach
@@ -68,68 +82,114 @@ ForEachMacros:
6882
- TEST_CASE
6983
- DYNAMIC_SECTION
7084
- BENCHMARK
85+
IfMacros:
86+
- KJ_IF_MAYBE
7187
IncludeBlocks: Preserve
7288
IncludeCategories:
7389
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
7490
Priority: 2
91+
SortPriority: 0
92+
CaseSensitive: false
7593
- Regex: '^(<|"(gtest|isl|json)/)'
7694
Priority: 3
95+
SortPriority: 0
96+
CaseSensitive: false
7797
- Regex: '.*'
7898
Priority: 1
99+
SortPriority: 0
100+
CaseSensitive: false
79101
IncludeIsMainRegex: '(Test)?$'
102+
IncludeIsMainSourceRegex: ''
103+
IndentAccessModifiers: false
80104
IndentCaseLabels: true
105+
IndentCaseBlocks: false
106+
IndentGotoLabels: true
81107
IndentPPDirectives: None
108+
IndentExternBlock: AfterExternBlock
109+
IndentRequires: false
82110
IndentWidth: 4
83111
IndentWrappedFunctionNames: false
112+
InsertTrailingCommas: None
84113
JavaScriptQuotes: Leave
85114
JavaScriptWrapImports: true
86115
KeepEmptyLinesAtTheStartOfBlocks: true
116+
LambdaBodyIndentation: Signature
87117
MacroBlockBegin: ''
88118
MacroBlockEnd: ''
89119
MaxEmptyLinesToKeep: 2
90120
NamespaceIndentation: None
91121
ObjCBinPackProtocolList: Auto
92122
ObjCBlockIndentWidth: 4
123+
ObjCBreakBeforeNestedBlockParam: true
93124
ObjCSpaceAfterProperty: false
94125
ObjCSpaceBeforeProtocolList: true
95126
PenaltyBreakAssignment: 2
96127
PenaltyBreakBeforeFirstCallParameter: 19
97128
PenaltyBreakComment: 300
98129
PenaltyBreakFirstLessLess: 120
130+
PenaltyBreakOpenParenthesis: 0
99131
PenaltyBreakString: 1000
100132
PenaltyBreakTemplateDeclaration: 10
101133
PenaltyExcessCharacter: 1000000
102134
PenaltyReturnTypeOnItsOwnLine: 60
135+
PenaltyIndentedWhitespace: 0
103136
PointerAlignment: Left
137+
PPIndentWidth: -1
138+
ReferenceAlignment: Left
104139
ReflowComments: true
105-
SortIncludes: false
106-
SortUsingDeclarations: true
140+
RemoveBracesLLVM: false
141+
SeparateDefinitionBlocks: Leave
142+
ShortNamespaceLines: 1
143+
SortIncludes: Never
144+
SortJavaStaticImport: Before
145+
SortUsingDeclarations: false
107146
SpaceAfterCStyleCast: false
108147
SpaceAfterLogicalNot: false
109148
SpaceAfterTemplateKeyword: true
110149
SpaceBeforeAssignmentOperators: true
150+
SpaceBeforeCaseColon: false
111151
SpaceBeforeCpp11BracedList: false
112152
SpaceBeforeCtorInitializerColon: true
113153
SpaceBeforeInheritanceColon: true
114-
SpaceBeforeParens: ControlStatementsExceptForEachMacros
154+
SpaceBeforeParens: ControlStatementsExceptControlMacros
155+
SpaceBeforeParensOptions:
156+
AfterControlStatements: true
157+
AfterForeachMacros: false
158+
AfterFunctionDefinitionName: false
159+
AfterFunctionDeclarationName: false
160+
AfterIfMacros: false
161+
AfterOverloadedOperator: false
162+
BeforeNonEmptyParentheses: false
163+
SpaceAroundPointerQualifiers: Default
115164
SpaceBeforeRangeBasedForLoopColon: true
165+
SpaceInEmptyBlock: false
116166
SpaceInEmptyParentheses: false
117167
SpacesBeforeTrailingComments: 1
118-
SpacesInAngles: false
168+
SpacesInAngles: Never
169+
SpacesInConditionalStatement: false
119170
SpacesInContainerLiterals: true
120171
SpacesInCStyleCastParentheses: false
172+
SpacesInLineCommentPrefix:
173+
Minimum: 1
174+
Maximum: -1
121175
SpacesInParentheses: false
122176
SpacesInSquareBrackets: false
123-
Standard: Cpp11
177+
SpaceBeforeSquareBrackets: false
178+
BitFieldColonSpacing: Both
179+
Standard: Latest
180+
StatementAttributeLikeMacros:
181+
- Q_EMIT
124182
StatementMacros:
125183
- Q_UNUSED
126184
- QT_REQUIRE_VERSION
127185
TabWidth: 4
186+
UseCRLF: false
128187
UseTab: Never
129-
---
130-
Language: Cpp
131-
DisableFormat: false
132-
---
133-
Language: ObjC
134-
DisableFormat: false
188+
WhitespaceSensitiveMacros:
189+
- STRINGIZE
190+
- PP_STRINGIZE
191+
- BOOST_PP_STRINGIZE
192+
- NS_SWIFT_NAME
193+
- CF_SWIFT_NAME
135194
...
195+

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Apply clang-format to all .cpp and .hpp files
2+
93b520449e01bfcdbe99c64186a878cda7c50c6e
3+
4+
# Reformat code (#7622)
5+
0d73fdd35a6b55ec57b4e13b6046bbf9dfec6622

.project

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@
2525
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
2626
</natures>
2727
<filteredResources>
28-
<filter>
29-
<id>1684928805201</id>
30-
<name>external</name>
31-
<type>30</type>
32-
<matcher>
33-
<id>org.eclipse.ui.ide.multiFilter</id>
34-
<arguments>1.0-name-matches-false-false-catch</arguments>
35-
</matcher>
36-
</filter>
3728
<filter>
3829
<id>1684928848403</id>
3930
<name>src/external</name>

CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# NEXT MAJOR RELEASE
23

34
### Enhancements
@@ -20,6 +21,68 @@
2021

2122
----------------------------------------------
2223

24+
# 14.6.0 Release notes
25+
26+
### Enhancements
27+
* Add `SyncClientConfig::security_access_group` which allows specifying the access group to use for the sync metadata Realm's encryption key. Setting this is required when sharing the metadata Realm between apps on Apple platforms ([PR #7552](https://github.com/realm/realm-core/pull/7552)).
28+
* When connecting to multiple server apps, a unique encryption key is used for each of the metadata Realms rather than sharing one between them ([#7552](https://github.com/realm/realm-core/pull/7552)).
29+
* 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)).
30+
* Improve perfomance of "chained OR equality" queries for UUID/ObjectId types and RQL parsed "IN" queries on string/int/uuid/objectid types. ([.Net #3566](https://github.com/realm/realm-dotnet/issues/3566), since the introduction of these types)
31+
* Introducing `Query::in()` which allows SDKs to take advantage of improved performance when building equality conditions against many constants. ([PR #7582](https://github.com/realm/realm-core/pull/7582))
32+
33+
### Fixed
34+
* 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)).
35+
* 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)).
36+
* Deleting the active user left the active user unset rather than selecting another logged-in user as the active user like logging out and removing users did. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
37+
* Fixed several issues around encrypted file portability (copying a "bundled" encrypted Realm from one device to another):
38+
* Fixed `Assertion failed: new_size % (1ULL << m_page_shift) == 0` when opening an encrypted Realm less than 64Mb that was generated on a platform with a different page size than the current platform. ([#7322](https://github.com/realm/realm-core/issues/7322), since v13.17.1)
39+
* Fixed a `DecryptionFailed` exception thrown when opening a small (<4k of data) Realm generated on a device with a page size of 4k if it was bundled and opened on a device with a larger page size (since the beginning).
40+
* Fixed an issue during a subsequent open of an encrypted Realm for some rare allocation patterns when the top ref was within ~50 bytes of the end of a page. This could manifest as a DecryptionFailed exception or as an assertion: `encrypted_file_mapping.hpp:183: Assertion failed: local_ndx < m_page_state.size()`. ([#7319](https://github.com/realm/realm-core/issues/7319))
41+
* Non-streaming download sync progress notification is fixed for flexible sync Realms where before it was sometimes stopping to emit values right after the registration of the callback ([#7561](https://github.com/realm/realm-core/issues/7561)).
42+
* Schema initialization could hit an assertion failure if the sync client applied a downloaded changeset while the Realm file was in the process of being opened ([#7041](https://github.com/realm/realm-core/issues/7041), since v11.4.0).
43+
* Queries using query paths on Mixed values returns inconsistent results ([#7587](https://github.com/realm/realm-core/issues/7587), since v14.0.0)
44+
* Enabling 'cancel_waits_on_nonfatal_error' does not cancel waits during location update while offline ([#7527](https://github.com/realm/realm-core/issues/7527), since v13.26.0)
45+
46+
### Breaking changes
47+
* The following things have been renamed or moved as part of moving all of the App Services functionality to the app namespace:
48+
- SyncUser -> app::User. Note that there is a new, different type named SyncUser.
49+
- 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.
50+
- SyncUserSubscriptionToken -> app::UserSubscriptionToken
51+
- SyncUserProfile -> app::UserProfile
52+
- App::Config -> AppConfig
53+
- SyncConfig::MetadataMode -> AppConfig::MetadataMode
54+
- MetadataMode::NoMetadata -> MetadataMode::InMemory
55+
- SyncUser::session_for_on_disk_path() -> SyncManager::get_existing_session()
56+
- SyncUser::all_sessions() -> SyncManager::get_all_sessions_for(User&)
57+
- SyncManager::immediately_run_file_actions() -> App::immediately_run_file_actions()
58+
- realm_sync_user_subscription_token -> realm_app_user_subscription_token ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
59+
* The `ClientAppDeallocated` error code no longer exists as this error code can no longer occur. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
60+
* 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)).
61+
* 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)).
62+
* AuditConfig now has a base_file_path field which must be set by the SDK rather than inheriting it from the SyncManager. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
63+
* App::switch_user() no longer returns a user. The return value was always exactly the passed-in user and any code which needs it can just use that. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
64+
* Non-streaming download progress callback no longer stops reporting values immediately after the registration (if the progress update has happened earlier), but waits for the next batch of data to start syncing to report its progress, since the previous behaviour was not useful (PR [#7561](https://github.com/realm/realm-core/issues/7561)).
65+
66+
### Compatibility
67+
* 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.
68+
69+
-----------
70+
71+
### Internals
72+
* App metadata storage has been entirely rewritten in preparation for supporting sharing metadata realms between processes. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
73+
* 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. The new mode is intended for testing purposes, but should be suitable for production usage if there is a scenario where metadata persistence is not needed. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
74+
* The ownership relationship between App and User has changed. User now strongly retains App and App has a weak cache of Users. This means that creating a SyncConfig or opening a Realm will keep the parent App alive, rather than things being in a broken state if the App is deallocated. ([PR #7300](https://github.com/realm/realm-core/pull/7300).
75+
* A new CMake define `REALM_APP_SERVICES` can be used to compile out core's default implmentation of the application services. ([#7268](https://github.com/realm/realm-core/issues/7268))
76+
* Fix a race condition in Promise which could result in an assertion failure if it was destroyed immediately after a `get()` on the Future returned. The problematic scenario only occurred in test code and not in library code ([PR #7602](https://github.com/realm/realm-core/pull/7602)).
77+
* Catch2 is no longer required as a submodule if the `REALM_NO_TESTS` flag is set.
78+
* Sha-2 is no longer required as a submodule on Windows if linking with OpenSSL.
79+
* The Catch2 submodule has moved to `test/external/catch`.
80+
* Fix possible file corruption if using Transaction::copy_to if nested collections are present.
81+
* Evergreen config was udpated so most linux CI testing is done on ubuntu 22.04 on aarch64 with clang 18, upgrading from clang 11 on ubuntu 20.04 mostly on x86_64 ([PR #7475](https://github.com/realm/realm-core/pull/7475)).
82+
* Evergreen config was updated to move most MacOS testing to MacOS 14 on arm64 with Xcode 15.2, updating from Macos 11 on x86_64 with Xcode 13.1 ([PR #7618](https://github.com/realm/realm-core/pull/7618)).
83+
84+
----------------------------------------------
85+
2386
# 14.5.2 Release notes
2487

2588
### Fixed

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,7 @@ install(FILES tools/cmake/AcquireRealmDependency.cmake
400400
COMPONENT devel
401401
)
402402

403-
if(REALM_BUILD_LIB_ONLY)
404-
set(REALM_EXCLUDE_TESTS EXCLUDE_FROM_ALL)
405-
endif()
406-
407-
if (NOT REALM_NO_TESTS)
403+
if(NOT REALM_BUILD_LIB_ONLY AND NOT REALM_NO_TESTS)
408404
enable_testing()
409405
add_subdirectory(test)
410406
endif()

Package.swift

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

6-
let versionStr = "14.5.2"
6+
let versionStr = "14.6.0"
77
let versionPieces = versionStr.split(separator: "-")
88
let versionCompontents = versionPieces[0].split(separator: ".")
99
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
@@ -354,8 +354,8 @@ let bidExcludes: [String] = [
354354

355355
let platforms: [SupportedPlatform] = [
356356
.macOS(.v10_13),
357-
.iOS(.v11),
358-
.tvOS(.v11),
357+
.iOS(.v12),
358+
.tvOS(.v12),
359359
.watchOS(.v4)
360360
]
361361

0 commit comments

Comments
 (0)