-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RCORE-1973 Add role/permissions tests for new bootstrap feature #7675
Changes from 31 commits
67691ce
2d304d5
8d91a08
e8924dc
ac79b1f
b78283e
d350217
f9aec9b
2d908be
1878811
89b2c39
363581c
990da9e
fb91292
5ad76e9
2eb382e
6092943
560cdb3
7951ef2
304e658
6994a85
579c50d
7983f9d
3f17ce6
524261a
48497b1
2d67e5d
2d27215
7ee0ad0
75c9654
321b889
9f4b041
f869865
2e5a010
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,15 @@ | |
|
||
### Enhancements | ||
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????)) | ||
* None. | ||
* Add support for server initiated bootstraps. ([PR #7440](https://github.com/realm/realm-core/pull/7440)) | ||
|
||
### Fixed | ||
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?) | ||
* 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) | ||
* 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) | ||
* 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) | ||
* 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)). | ||
* If a sync session is interrupted by a disconnect or restart while downloading a bootstrap, stale data from the previous bootstrap may be included when the session reconnects and downloads the bootstrap. This can lead to objects stored in the database that do not match the actual state of the server and potentially leading to compensating writes. ([#7827](https://github.com/realm/realm-core/issues/7827), since v12.0.0) | ||
|
||
### Breaking changes | ||
* None. | ||
|
@@ -22,6 +23,8 @@ | |
### Internals | ||
* 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) | ||
* Upload completion is now tracked in a multiprocess-compatible manner ([PR #7796](https://github.com/realm/realm-core/pull/7796)). | ||
* Protocol version has been updated to v14 to support server intiated bootstraps and role change updates without a client reset. ([PR #7440](https://github.com/realm/realm-core/pull/7440)) | ||
* Create additional role change tests to verify role change during initial schema and subscription bootstraps. ([PR #7675](https://github.com/realm/realm-core/pull/7675)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need a changelog entry for just adding new tests. |
||
|
||
---------------------------------------------- | ||
|
||
|
@@ -54,7 +57,6 @@ | |
* It is no longer an error to set a base url for an App with a trailing slash - for example, `https://services.cloud.mongodb.com/` instead of `https://services.cloud.mongodb.com` - before this change that would result in a 404 error from the server ([PR #7791](https://github.com/realm/realm-core/pull/7791)). | ||
* Performance has been improved for range queries on integers and timestamps. Requires that you use the "BETWEEN" operation in MQL or the Query::between() method when you build the query. (PR [#7785](https://github.com/realm/realm-core/pull/7785)) | ||
* Expose `Obj::add_int()` in the bindgen spec. ([PR #7797](https://github.com/realm/realm-core/pull/7797)). | ||
* Add support for server initiated bootstraps. ([PR #7440](https://github.com/realm/realm-core/pull/7440)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see, you're handling merge conflicts so these are going to jump during each PR remaining for this project |
||
|
||
### Fixed | ||
* Valgrind could report a branch on an uninitialized read when opening something that is not an encrypted Realm file as an encrypted Realm file ([PR #7789](https://github.com/realm/realm-core/pull/7789), since v14.10.0). | ||
|
@@ -72,7 +74,6 @@ | |
|
||
### Internals | ||
* Switch to building the Swift package and Cocoa binaries as C++20 ([PR #7802](https://github.com/realm/realm-core/pull/7802)). | ||
* Protocol version has been updated to v14 to support server intiated bootstraps and role change updates without a client reset. ([PR #7440](https://github.com/realm/realm-core/pull/7440)) | ||
|
||
---------------------------------------------- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -836,7 +836,7 @@ bool SessionImpl::process_flx_bootstrap_message(const SyncProgress& progress, Do | |
} | ||
|
||
try { | ||
process_pending_flx_bootstrap(); | ||
process_pending_flx_bootstrap(); // throws | ||
} | ||
catch (const IntegrationException& e) { | ||
on_integration_failure(e); | ||
|
@@ -855,8 +855,6 @@ void SessionImpl::process_pending_flx_bootstrap() | |
if (!m_is_flx_sync_session || m_state != State::Active) { | ||
return; | ||
} | ||
// Should never be called if session is not active | ||
REALM_ASSERT_EX(m_state == SessionImpl::Active, m_state); | ||
auto bootstrap_store = m_wrapper.get_flx_pending_bootstrap_store(); | ||
if (!bootstrap_store->has_pending()) { | ||
return; | ||
|
@@ -1185,6 +1183,10 @@ void SessionWrapper::on_flx_sync_progress(int64_t new_version, DownloadBatchStat | |
if (!has_flx_subscription_store()) { | ||
return; | ||
} | ||
// Is this a server-initiated bootstrap? Skip notifying the subscription store | ||
if (new_version == m_flx_active_version) { | ||
return; | ||
} | ||
REALM_ASSERT(!m_finalized); | ||
REALM_ASSERT(new_version >= m_flx_last_seen_version); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't new_version always be either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a query bootstrap is in progress when a server initiated bootstrap takes place (which cancels the current query bootstrap), There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's still one of the cases I mentioned. I was proposing we update the assert, not keep the deleted one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would update it, but this is a change that might affect progress notifications, which uses this value. I created RCORE-2173 to handle updating this separately if we want to update it. |
||
REALM_ASSERT(new_version >= m_flx_active_version); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1527,6 +1527,16 @@ void Session::cancel_resumption_delay() | |
if (unbind_process_complete()) | ||
initiate_rebind(); // Throws | ||
|
||
try { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this different from #7831 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It probably wasn't the best (or correct) way to do it, but PR #7831 was branched off of this PR branch, since it needed tests from this PR in order to validate the changes... |
||
process_pending_flx_bootstrap(); // throws | ||
} | ||
catch (const IntegrationException& error) { | ||
on_integration_failure(error); | ||
} | ||
catch (...) { | ||
on_integration_failure(IntegrationException(exception_to_status())); | ||
} | ||
|
||
m_conn.one_more_active_unsuspended_session(); // Throws | ||
if (m_try_again_activation_timer) { | ||
m_try_again_activation_timer.reset(); | ||
|
@@ -1717,7 +1727,7 @@ void Session::activate() | |
m_conn.one_more_active_unsuspended_session(); // Throws | ||
|
||
try { | ||
process_pending_flx_bootstrap(); | ||
process_pending_flx_bootstrap(); // throws | ||
} | ||
catch (const IntegrationException& error) { | ||
on_integration_failure(error); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't this already done in a separate PR? Should this be under Internals? What is a user or SDK developer supposed to take away from this changelog entry? How will this effect them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this comment to the internal section and added a new comment to Enhancements:
Role and permissions changes no longer require a client reset to update the local realm.