Skip to content

Commit

Permalink
Fix issue when waiting for upload on a file produced by 'write_copy()'
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Mar 4, 2022
1 parent 19420d5 commit f272ee6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Mixed::compare() used inconsistent rounding for comparing a Decimal128 to a float, giving different results from comparing those values directly ([#5270](https://github.com/realm/realm-core/pull/5270)).
* Calling Realm::async_begin_transaction() from within a write transaction while the async state was idle would hit an assertion failure (since v11.10.0).
* Fix issue with scheduler being deleted on wrong thread. This caused async open to hang in eg. realm-js. ([#5287](https://github.com/realm/realm-core/pull/5287), Since v11.10.0)
* Waiting for upload after opening a bundled realm file could hang. ([#5277](https://github.com/realm/realm-core/issues/5277), since v11.5.0)

### Breaking changes
* None.
Expand Down
1 change: 1 addition & 0 deletions src/realm/sync/noinst/client_impl_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,7 @@ std::error_code Session::receive_ident_message(SaltedFileIdent client_file_ident
repl.get_history().set_client_file_ident(client_file_ident, fix_up_object_ids); // Throws
this->m_progress.download.last_integrated_client_version = 0;
this->m_progress.upload.client_version = 0;
this->m_last_version_selected_for_upload = 0;
}

// Ready to send the IDENT message
Expand Down
2 changes: 2 additions & 0 deletions test/object-store/realm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ TEST_CASE("Get Realm using Async Open", "[asyncOpen]") {
// Now open a realm based on the realm file created above
auto realm = Realm::get_shared_realm(config3);
wait_for_download(*realm);
wait_for_upload(*realm);

// Make sure we have got a new client file id
REQUIRE(realm->read_group().get_sync_file_id() != client_file_id);
REQUIRE(realm->read_group().get_table("class_object")->size() == 3);
Expand Down

0 comments on commit f272ee6

Please sign in to comment.