Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Fix the check for if the ResultSets schema needs to be initialized #815

Merged
merged 1 commit into from
Aug 19, 2019
Merged
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
4 changes: 2 additions & 2 deletions src/sync/partial_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ void ensure_partial_sync_schema_initialized(Realm& realm)
auto& group = realm.read_group();
// Check if the result sets table already has the expected number of columns
auto table = ObjectStore::table_for_object_type(group, result_sets_type_name);
if (table && table->size() >= result_sets_property_count)
if (table && table->get_column_count() >= result_sets_property_count)
return;

realm.begin_transaction();
// Recheck after starting the transaction as it refreshes
if (!table)
table = ObjectStore::table_for_object_type(group, result_sets_type_name);
if (table && table->size() >= result_sets_property_count)
if (table && table->get_column_count() >= result_sets_property_count)
return;
initialize_schema(group);
realm.commit_transaction();
Expand Down