Skip to content

Commit e079db6

Browse files
authored
Merge pull request #7599 from realm/release/14.5.2
Release/14.5.2
2 parents a19489c + 72cc172 commit e079db6

15 files changed

+197
-38
lines changed

CHANGELOG.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* 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)
1616
* 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).
1717
* 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))
18-
* Fix compilation errors when using command-line `swift build` ([#7587](https://github.com/realm/realm-core/pull/7587), since v14.5.1).
19-
* Fixed crash when integrating removal of already removed dictionary key ([#7488](https://github.com/realm/realm-core/issues/7488), since v10.0.0).
2018
* 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 (PR [#7561](https://github.com/realm/realm-core/issues/7561)).
2119

2220
### Breaking changes
@@ -52,6 +50,22 @@
5250

5351
----------------------------------------------
5452

53+
# 14.5.2 Release notes
54+
55+
### Fixed
56+
* Fix compilation errors when using command-line `swift build` ([#7587](https://github.com/realm/realm-core/pull/7587), since v14.5.1).
57+
* Fixed crash when integrating removal of already removed dictionary key ([#7488](https://github.com/realm/realm-core/issues/7488), since v10.0.0).
58+
59+
### Compatibility
60+
* 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.
61+
62+
-----------
63+
64+
### Internals
65+
* `prior_size` field in Clear instruction is being repurposed as `collection_type` (no protocol changes required)
66+
67+
----------------------------------------------
68+
5569
# 14.5.1 Release notes
5670

5771
### 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.5.1"
6+
let versionStr = "14.5.2"
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.5.1
2+
VERSION: 14.5.2
33
OPENSSL_VERSION: 3.2.0
44
ZLIB_VERSION: 1.2.13
55
# https://github.com/10gen/baas/commits

src/realm/sync/changeset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ void Changeset::Reflector::operator()(const Instruction::AddColumn& p) const
431431
if (p.type == Instruction::Payload::Type::Link) {
432432
m_tracer.field("target_table", p.link_target_table);
433433
}
434-
if (p.collection_type == Instruction::AddColumn::CollectionType::Dictionary) {
434+
if (p.collection_type == Instruction::CollectionType::Dictionary) {
435435
m_tracer.field("key_type", p.key_type);
436436
}
437437
}
@@ -505,7 +505,7 @@ void Changeset::Printer::field(StringData n, Instruction::Payload::Type type)
505505
print_field(n, get_type_name(type));
506506
}
507507

508-
void Changeset::Printer::field(StringData n, Instruction::AddColumn::CollectionType type)
508+
void Changeset::Printer::field(StringData n, Instruction::CollectionType type)
509509
{
510510
print_field(n, get_collection_type(type));
511511
}

src/realm/sync/changeset.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ struct Changeset::Reflector {
348348
util::Optional<InternString> field, const Instruction::Path* path) = 0;
349349
virtual void field(StringData, InternString) = 0;
350350
virtual void field(StringData, Instruction::Payload::Type) = 0;
351-
virtual void field(StringData, Instruction::AddColumn::CollectionType) = 0;
351+
virtual void field(StringData, Instruction::CollectionType) = 0;
352352
virtual void field(StringData, const Instruction::PrimaryKey&) = 0;
353353
virtual void field(StringData, const Instruction::Payload&) = 0;
354354
virtual void field(StringData, const Instruction::Path&) = 0;
@@ -393,7 +393,7 @@ struct Changeset::Printer : Changeset::Reflector::Tracer {
393393
const Instruction::Path* path) final;
394394
void field(StringData, InternString) final;
395395
void field(StringData, Instruction::Payload::Type) final;
396-
void field(StringData, Instruction::AddColumn::CollectionType) final;
396+
void field(StringData, Instruction::CollectionType) final;
397397
void field(StringData, const Instruction::PrimaryKey&) final;
398398
void field(StringData, const Instruction::Payload&) final;
399399
void field(StringData, const Instruction::Path&) final;

src/realm/sync/changeset_encoder.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void ChangesetEncoder::append_value(Instruction::Payload::Type type)
121121
append_value(int64_t(type));
122122
}
123123

124-
void ChangesetEncoder::append_value(Instruction::AddColumn::CollectionType type)
124+
void ChangesetEncoder::append_value(Instruction::CollectionType type)
125125
{
126126
append_value(uint8_t(type));
127127
}
@@ -190,7 +190,7 @@ void ChangesetEncoder::operator()(const Instruction::AddInteger& instr)
190190

191191
void ChangesetEncoder::operator()(const Instruction::AddColumn& instr)
192192
{
193-
bool is_dictionary = (instr.collection_type == Instruction::AddColumn::CollectionType::Dictionary);
193+
bool is_dictionary = (instr.collection_type == Instruction::CollectionType::Dictionary);
194194
// Mixed columns are always nullable.
195195
REALM_ASSERT(instr.type != Instruction::Payload::Type::Null || instr.nullable || is_dictionary);
196196
append(Instruction::Type::AddColumn, instr.table, instr.field, instr.type, instr.nullable, instr.collection_type);
@@ -225,8 +225,7 @@ void ChangesetEncoder::operator()(const Instruction::ArrayErase& instr)
225225

226226
void ChangesetEncoder::operator()(const Instruction::Clear& instr)
227227
{
228-
uint32_t prior_size = 0; // Ignored
229-
append_path_instr(Instruction::Type::Clear, instr, prior_size);
228+
append_path_instr(Instruction::Type::Clear, instr, instr.collection_type);
230229
}
231230

232231
void ChangesetEncoder::operator()(const Instruction::SetInsert& instr)

src/realm/sync/changeset_encoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct ChangesetEncoder {
4949
void append_value(const Instruction::Payload::Link&);
5050
void append_value(Instruction::Payload::Type);
5151
void append_value(util::Optional<Instruction::Payload::Type>);
52-
void append_value(Instruction::AddColumn::CollectionType);
52+
void append_value(Instruction::CollectionType);
5353
void append_value(const Instruction::Path&);
5454
void append_value(DataType);
5555
void append_value(bool);

src/realm/sync/changeset_parser.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct State {
5454

5555
util::Optional<Instruction::Payload::Type> read_optional_payload_type();
5656
Instruction::Payload::Type read_payload_type();
57-
Instruction::AddColumn::CollectionType read_collection_type();
57+
Instruction::CollectionType read_collection_type();
5858
Instruction::Payload read_payload();
5959
Instruction::Payload::Link read_link();
6060
Instruction::PrimaryKey read_object_key();
@@ -179,10 +179,10 @@ Instruction::Payload::Type State::read_payload_type()
179179
parser_error("Unsupported data type");
180180
}
181181

182-
Instruction::AddColumn::CollectionType State::read_collection_type()
182+
Instruction::CollectionType State::read_collection_type()
183183
{
184-
using CollectionType = Instruction::AddColumn::CollectionType;
185-
auto type = Instruction::AddColumn::CollectionType(read_int<uint8_t>());
184+
using CollectionType = Instruction::CollectionType;
185+
auto type = Instruction::CollectionType(read_int<uint8_t>());
186186
// Validate the type.
187187
switch (type) {
188188
case CollectionType::Single:
@@ -435,7 +435,7 @@ void State::parse_one()
435435
if (instr.type == Instruction::Payload::Type::Link) {
436436
instr.link_target_table = read_intern_string();
437437
}
438-
if (instr.collection_type == Instruction::AddColumn::CollectionType::Dictionary) {
438+
if (instr.collection_type == Instruction::CollectionType::Dictionary) {
439439
instr.key_type = read_payload_type();
440440
}
441441
else {
@@ -486,8 +486,8 @@ void State::parse_one()
486486
case Instruction::Type::Clear: {
487487
Instruction::Clear instr;
488488
read_path_instr(instr);
489-
uint32_t prior_size = read_int<uint32_t>();
490-
static_cast<void>(prior_size); // Ignored
489+
instr.collection_type = read_collection_type();
490+
// TODO: Add validation for collection_type once BAAS-29262 is done
491491
m_handler(instr);
492492
return;
493493
}

src/realm/sync/instruction_applier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ void InstructionApplier::operator()(const Instruction::AddInteger& instr)
550550
void InstructionApplier::operator()(const Instruction::AddColumn& instr)
551551
{
552552
using Type = Instruction::Payload::Type;
553-
using CollectionType = Instruction::AddColumn::CollectionType;
553+
using CollectionType = Instruction::CollectionType;
554554

555555
// Temporarily swap out the last object key so it doesn't get included in error messages
556556
TemporarySwapOut<decltype(m_last_object_key)> last_object_key_guard(m_last_object_key);

src/realm/sync/instruction_replication.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void SyncReplication::insert_column(const Table* table, ColKey col_key, DataType
328328
Table* target_table)
329329
{
330330
Replication::insert_column(table, col_key, type, name, target_table);
331-
using CollectionType = Instruction::AddColumn::CollectionType;
331+
using CollectionType = Instruction::CollectionType;
332332

333333
if (select_table(*table)) {
334334
Instruction::AddColumn instr;
@@ -570,6 +570,7 @@ void SyncReplication::list_clear(const CollectionBase& view)
570570
if (select_collection(view)) {
571571
Instruction::Clear instr;
572572
populate_path_instr(instr, view);
573+
instr.collection_type = Instruction::CollectionType::List;
573574
emit(instr);
574575
}
575576
}
@@ -605,6 +606,7 @@ void SyncReplication::set_clear(const CollectionBase& set)
605606
if (select_collection(set)) {
606607
Instruction::Clear instr;
607608
populate_path_instr(instr, set);
609+
instr.collection_type = Instruction::CollectionType::Set;
608610
emit(instr);
609611
}
610612
}
@@ -663,6 +665,7 @@ void SyncReplication::dictionary_clear(const CollectionBase& dict)
663665
if (select_collection(dict)) {
664666
Instruction::Clear instr;
665667
populate_path_instr(instr, dict);
668+
instr.collection_type = Instruction::CollectionType::Dictionary;
666669
emit(instr);
667670
}
668671
}

0 commit comments

Comments
 (0)