Skip to content

Commit fb46803

Browse files
authored
Merge pull request #7796 from realm/tg/upload-completion
RCORE-2160 Make upload completion reporting multiprocess-compatible
2 parents 83ba52f + c6b7d3d commit fb46803

File tree

11 files changed

+165
-309
lines changed

11 files changed

+165
-309
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* 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)
1010
* 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)
1111
* 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)
12+
* 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)).
1213

1314
### Breaking changes
1415
* None.
@@ -20,6 +21,7 @@
2021

2122
### Internals
2223
* 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)
24+
* Upload completion is now tracked in a multiprocess-compatible manner ([PR #7796](https://github.com/realm/realm-core/pull/7796)).
2325

2426
----------------------------------------------
2527

src/realm/chunked_binary.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ bool ChunkedBinaryData::is_null() const
4545
return chunk.is_null();
4646
}
4747

48+
bool ChunkedBinaryData::empty() const
49+
{
50+
BinaryIterator copy = m_begin;
51+
BinaryData chunk = copy.get_next();
52+
return chunk.size() == 0;
53+
}
54+
4855
char ChunkedBinaryData::operator[](size_t index) const
4956
{
5057
BinaryIterator copy = m_begin;

src/realm/chunked_binary.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class ChunkedBinaryData {
5454
/// the first chunk points to the nullptr.
5555
bool is_null() const;
5656

57+
/// Equivalent to `size() == 0`, but O(1) rather than O(N).
58+
bool empty() const;
59+
5760
/// FIXME: O(n)
5861
char operator[](size_t index) const;
5962

0 commit comments

Comments
 (0)