From 1f2173b5999297e082da518e5d3631b3db21fc9b Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Sat, 3 Mar 2018 12:55:11 +0100 Subject: [PATCH] Avoid Table::clear() when using partial sync (#1680) * Avoid Table::clear() when using partial sync * Updated to sync 3.0.0-beta.10 * Update object store --- CHANGELOG.md | 4 ++-- src/js_realm.hpp | 8 +++++++- src/object-store | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c427cf..384a78f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,8 @@ * [Sync] Added class `Realm.Sync.Subscription` to support partial synced Realms. ### Internal -* Updated to Realm Core 5.8.0. -* Updated to Realm Sync 3.0.0-beta.9. +* Updated to Realm Core 5.3.0. +* Updated to Realm Sync 3.0.0-beta.10. * Tested against Realm Object Server 3.0.0-alpha.8. diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 961032a7..2d0a8d57 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -898,7 +898,13 @@ void RealmClass::delete_all(ContextType ctx, ObjectType this_object, Argument } for (auto objectSchema : realm->schema()) { - ObjectStore::table_for_object_type(realm->read_group(), objectSchema.name)->clear(); + auto table = ObjectStore::table_for_object_type(realm->read_group(), objectSchema.name); + if (realm->is_partial()) { + realm::Results(realm, *table).clear(); + } + else { + table->clear(); + } } } diff --git a/src/object-store b/src/object-store index bb559df9..b250563e 160000 --- a/src/object-store +++ b/src/object-store @@ -1 +1 @@ -Subproject commit bb559df9237ece49f9c889993f7c1aff619b48f9 +Subproject commit b250563ea1eb9f32ec7dbd76f2c6f8f1a26914cc