-
Notifications
You must be signed in to change notification settings - Fork 168
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
Allow collections of non-embedded objects in asymmetric objects #7003
Conversation
8d412d0
to
5a62526
Compare
Pull Request Test Coverage Report for Build github_pull_request_277462
💛 - Coveralls |
4422de3
to
fc51de8
Compare
@@ -2916,17 +2956,26 @@ TEST_CASE("flx: data ingest", "[sync][flx][data ingest][baas]") { | |||
|
|||
auto table = realm->read_group().get_table("class_Asymmetric"); | |||
REQUIRE(table->size() == 0); | |||
|
|||
auto documents = get_documents(*realm->config().sync_config->user, "Asymmetric", 100); | |||
for (int i = 0; i < 100; ++i) { |
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.
nit: use the container size (i.e, obj_ids.size()) (+ in some other places below)
realm->commit_transaction(); | ||
|
||
wait_for_upload(*realm); | ||
wait_for_download(*realm); | ||
|
||
auto table = realm->read_group().get_table("class_Asymmetric"); | ||
REQUIRE(table->size() == 0); | ||
|
||
auto documents = get_documents(*realm->config().sync_config->user, "Asymmetric", 2); | ||
check_document(documents, foo_obj_id, {{"embedded obj", BsonDocument{{"value", "foo"}}}}); |
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.
should we check the second doc was created as well?
test/object-store/sync/flx_sync.cpp
Outdated
@@ -2864,17 +2903,19 @@ TEST_CASE("flx: data ingest", "[sync][flx][data ingest][baas]") { | |||
Object::create(c, realm, "Asymmetric", std::any(AnyDict{{"_id", foo_obj_id}, {"location", "foo"s}})); | |||
Object::create(c, realm, "Asymmetric", std::any(AnyDict{{"_id", bar_obj_id}, {"location", "bar"s}})); | |||
realm->commit_transaction(); | |||
wait_for_upload(*realm); | |||
|
|||
auto documents = get_documents(*realm->config().sync_config->user, "Asymmetric", 2); |
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.
you should wait for upload before getting the documents. This works too because sync is not stopped, but you are querying the server unnecessarily (should be added in some other places below as well).
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.
Waiting for the upload to complete before polling doesn't really change how many times we poll. Upload completion happens about a quarter of the way through the time to when the documents are visible for asymmetric sync (and about 1% of the way for non-asymmetric).
fc51de8
to
1426620
Compare
be58eae
to
b54fe1b
Compare
It's unclear if this actually caused any problems, but there were a number of places where we were deleting Realm files while they were in use due to copying a TestFile and then deleting the copy when we actually wanted to copy the config.
The schema validation checks forbidding this were removed in #6981, but Table also had its own validation.
b54fe1b
to
8278d2b
Compare
The schema validation checks forbidding this were removed in #6981, but Table
also had its own validation. Most of the changes here are just making the asymmetric sync tests verify that the expected documents are actually created on the server.