Skip to content

RCORE-2160 Make upload completion reporting multiprocess-compatible #7796

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

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* 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)).

### Breaking changes
* None.
Expand All @@ -20,6 +21,7 @@

### 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)).

----------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions src/realm/chunked_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ bool ChunkedBinaryData::is_null() const
return chunk.is_null();
}

bool ChunkedBinaryData::empty() const
{
BinaryIterator copy = m_begin;
BinaryData chunk = copy.get_next();
return chunk.size() == 0;
}

char ChunkedBinaryData::operator[](size_t index) const
{
BinaryIterator copy = m_begin;
Expand Down
3 changes: 3 additions & 0 deletions src/realm/chunked_binary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class ChunkedBinaryData {
/// the first chunk points to the nullptr.
bool is_null() const;

/// Equivalent to `size() == 0`, but O(1) rather than O(N).
bool empty() const;

/// FIXME: O(n)
char operator[](size_t index) const;

Expand Down
Loading
Loading