Skip to content

Commit ea5c960

Browse files
RCORE-2030 Add full support for automatic client reset for collections in mixed (#7683)
* Add full support for automatic client reset for collections in mixed * Changes after code review * Add more tests for better coverage * Update changelog * Add integration test and bump baas version
1 parent 1d3e626 commit ea5c960

File tree

10 files changed

+1827
-283
lines changed

10 files changed

+1827
-283
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
### Enhancements
44
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????))
5-
* None.
5+
* Nested collections have full support for automatic client reset ([PR #7683](https://github.com/realm/realm-core/pull/7683)).
66

77
### Fixed
88
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
99
* Accessing App::current_user() from within a notification produced by App:switch_user() (which includes notifications for a newly logged in user) would deadlock ([#7670](https://github.com/realm/realm-core/issues/7670), since v14.6.0).
1010
* Inserting the same typed link to the same key in a dictionary more than once would incorrectly create multiple backlinks to the object. This did not appear to cause any crashes later, but would have affecting explicit backlink count queries (eg: `...@links.@count`) and possibly notifications ([#7676](https://github.com/realm/realm-core/issues/7676) since v14.5.2).
11+
* Automatic client reset recovery would crash when recovering AddInteger instructions on a Mixed property if its type was changed to non-integer ([PR #7683](https://github.com/realm/realm-core/pull/7683), since v11.16.0).
1112

1213
### Breaking changes
1314
* None.

dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ VERSION: 14.6.2
33
OPENSSL_VERSION: 3.2.0
44
ZLIB_VERSION: 1.2.13
55
# https://github.com/10gen/baas/commits
6-
# 5138f5c is 2024 Apr 19
7-
BAAS_VERSION: 5138f5c924f9f376d31cbc2b1819e1d934600277
6+
# 9d1b4d6 is 2024 May 8
7+
BAAS_VERSION: 9d1b4d628babadfb606ebcadb93b1e5cae3c9565

src/realm/object_converter.cpp

Lines changed: 112 additions & 91 deletions
Large diffs are not rendered by default.

src/realm/object_converter.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ struct InterRealmValueConverter {
5151
int cmp_src_to_dst(Mixed src, Mixed dst, ConversionResult* converted_src_out = nullptr,
5252
bool* did_update_out = nullptr) const;
5353
void copy_value(const Obj& src_obj, Obj& dst_obj, bool* update_out);
54+
void copy_list(const LstBase& src_list, LstBase& dst_list) const;
5455

5556
private:
5657
void copy_list(const LstBase& src_obj, LstBase& dst_obj, bool* update_out) const;
@@ -63,10 +64,10 @@ struct InterRealmValueConverter {
6364
CollectionType type) const;
6465
void copy_dictionary_in_mixed(const Dictionary& src_list, Dictionary& dst_list, StringData key,
6566
CollectionType type) const;
66-
bool check_matching_list(const Lst<Mixed>& src_list, Lst<Mixed>& dst_list, size_t ndx_src, size_t ndx_dst,
67-
CollectionType type) const;
68-
bool check_matching_dictionary(const Dictionary& src_list, const Dictionary& dst_list, StringData key,
69-
CollectionType type) const;
67+
bool check_if_list_elements_match(const Lst<Mixed>& src_list, Lst<Mixed>& dst_list, size_t ndx_src,
68+
size_t ndx_dst) const;
69+
bool check_if_dictionary_elements_match(const Dictionary& src_list, const Dictionary& dst_list,
70+
StringData key) const;
7071
bool is_collection(Mixed) const;
7172
CollectionType to_collection_type(Mixed) const;
7273

src/realm/sync/changeset.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ void Changeset::Reflector::operator()(const Instruction::Clear& p) const
399399
{
400400
m_tracer.name("Clear");
401401
path_instr(p);
402+
m_tracer.field("collection_type", p.collection_type);
402403
}
403404

404405
void Changeset::Reflector::operator()(const Instruction::SetInsert& p) const

0 commit comments

Comments
 (0)