diff --git a/CHANGELOG.md b/CHANGELOG.md index cb5fee60..d64fedd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ -x.x.x Release notes (yyyy-MM-dd) ============================================================= ### Enhancements * None. ### Fixed -* ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?) -* Removed calls to `new Buffer()` as this is deprecated with Node 10. ([#2107](https://github.com/realm/realm-js/issues/2107), since 2.19.0) -* Updated the type definitions to be explicit that the return type of the generics `Realm.objects`, `Realm.objectForPrimaryKey`, etc. is an intersection of `T & Realm.Object`. ([#1838](https://github.com/realm/realm-js/issues/1838)) +* The Typescript definition for `Realm.Permissions.Permission` did not have the correct `role` property defined. This could result in compilation errors like this `error TS2339: Property 'role' does not exist on type 'Permission'`. ([#2106](https://github.com/realm/realm-js/pull/2106), since v2.3.0.) +* Removes calls to `new Buffer()` as this is deprecated with Node 10. ([#2107](https://github.com/realm/realm-js/issues/2107), since v2.19.0) +* Updates the type definitions to be explicit that the return type of the generics `Realm.objects`, `Realm.objectForPrimaryKey`, etc. is an intersection of `T & Realm.Object`. ([#1838](https://github.com/realm/realm-js/issues/1838)) +* A set of bugs that could lead to bad changesets have been fixed. An example of error message is `Failed to parse, or apply received changeset: ndx out of range`. (Fixed by Realm Sync v3.13.3) ### Compatibility * Realm Object Server: 3.11.0 or later. @@ -14,25 +14,11 @@ x.x.x Release notes (yyyy-MM-dd) * File format: Generates Realms with format v9 (Reads and upgrades all previous formats) ### Internal -* Introduce 100 ms delay before submitting analytics so that an app may disable it after importing Realm. ([#2108](https://github.com/realm/realm-js/pull/2108)) +* Introduces 100 ms delay before submitting analytics so that an app may disable it after importing Realm. ([#2108](https://github.com/realm/realm-js/pull/2108)) * Distinguish between node.js and electron in the `BindingType` field when submitting analytics. ([#2108](https://github.com/realm/realm-js/pull/2108)) -* Add a package to compute the Windows analytics identifier rather than returning `null` which likely accounts for the disproportionally large number of unique Windows users. ([#2108](https://github.com/realm/realm-js/pull/2108)) - -x.x.x Release notes (yyyy-MM-dd) -============================================================= -### Enhancements -* None. - -### Fixed -* The Typescript definition for `Realm.Permissions.Permission` did not have the correct `role` property defined. This could result in compilation errors like this "error TS2339: Property 'role' does not exist on type 'Permission'". Since 2.3.0. ([#2106](https://github.com/realm/realm-js/pull/2106)) - -### Compatibility -* Realm Object Server: 3.11.0 or later. -* APIs are backwards compatible with all previous release of realm in the 2.x.y series. -* File format: Generates Realms with format v9 (Reads and upgrades all previous formats) - - ### Internal -* None. +* Adds a package to compute the Windows analytics identifier rather than returning `null` which likely accounts for the disproportionally large number of unique Windows users. ([#2108](https://github.com/realm/realm-js/pull/2108)) +* Upgrades to Realm Core v5.12.1. +* Upgrades to Realm Sync v3.13.3. 2.19.0 Release notes (2018-11-8) ============================================================= diff --git a/dependencies.list b/dependencies.list index dc18b92d..0cabe467 100644 --- a/dependencies.list +++ b/dependencies.list @@ -1,5 +1,5 @@ PACKAGE_NAME=realm-js VERSION=2.19.0 -REALM_CORE_VERSION=5.12.0 -REALM_SYNC_VERSION=3.13.1 +REALM_CORE_VERSION=5.12.1 +REALM_SYNC_VERSION=3.13.3 REALM_OBJECT_SERVER_VERSION=3.11.1 diff --git a/src/js_object_accessor.hpp b/src/js_object_accessor.hpp index 55c96128..2498c5b1 100644 --- a/src/js_object_accessor.hpp +++ b/src/js_object_accessor.hpp @@ -85,7 +85,7 @@ public: } template - T unbox(ValueType value, bool create = false, bool update = false); + T unbox(ValueType value, bool create = false, bool update = false, bool only_update_diff_objects = false, size_t current_row = realm::npos); template util::Optional unbox_optional(ValueType value) { @@ -171,63 +171,63 @@ private: namespace _impl { template struct Unbox { - static bool call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static bool call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return js::Value::validated_to_boolean(ctx->m_ctx, value, "Property"); } }; template struct Unbox { - static int64_t call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static int64_t call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return js::Value::validated_to_number(ctx->m_ctx, value, "Property"); } }; template struct Unbox { - static float call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static float call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return js::Value::validated_to_number(ctx->m_ctx, value, "Property"); } }; template struct Unbox { - static double call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static double call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return js::Value::validated_to_number(ctx->m_ctx, value, "Property"); } }; template struct Unbox> { - static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return ctx->template unbox_optional(value); } }; template struct Unbox> { - static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return ctx->template unbox_optional(value); } }; template struct Unbox> { - static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return ctx->template unbox_optional(value); } }; template struct Unbox> { - static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { return ctx->template unbox_optional(value); } }; template struct Unbox { - static StringData call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static StringData call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { if (ctx->is_null(value)) { return StringData(); } @@ -238,7 +238,7 @@ struct Unbox { template struct Unbox { - static BinaryData call(NativeAccessor *ctx, typename JSEngine::Value value, bool, bool) { + static BinaryData call(NativeAccessor *ctx, typename JSEngine::Value value, bool, bool, bool, size_t) { if (ctx->is_null(value)) { return BinaryData(); } @@ -265,14 +265,14 @@ struct Unbox { template struct Unbox { - static Mixed call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static Mixed call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { throw std::runtime_error("'Any' type is unsupported"); } }; template struct Unbox { - static Timestamp call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { + static Timestamp call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool, bool, size_t) { if (ctx->is_null(value)) { return Timestamp(); } @@ -293,7 +293,7 @@ struct Unbox { template struct Unbox { - static RowExpr call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool create, bool try_update) { + static RowExpr call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool create, bool try_update, bool only_update_diffed, size_t current_row) { using Value = js::Value; using ValueType = typename JSEngine::Value; @@ -316,7 +316,7 @@ struct Unbox { } auto child = realm::Object::create(*ctx, ctx->m_realm, *ctx->m_object_schema, - static_cast(object), try_update); + static_cast(object), try_update, only_update_diffed, current_row); return child.row(); } }; @@ -324,8 +324,8 @@ struct Unbox { template template -U NativeAccessor::unbox(ValueType value, bool create, bool update) { - return _impl::Unbox::call(this, std::move(value), create, update); +U NativeAccessor::unbox(ValueType value, bool create, bool update, bool only_update_diff_objects, size_t current_row) { + return _impl::Unbox::call(this, std::move(value), create, update, only_update_diff_objects, current_row); } template diff --git a/src/js_realm.cpp b/src/js_realm.cpp index 687603aa..c2bcbf4c 100644 --- a/src/js_realm.cpp +++ b/src/js_realm.cpp @@ -59,7 +59,7 @@ void clear_test_state() { user->log_out(); } SyncManager::shared().reset_for_testing(); - SyncManager::shared().configure_file_system(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption); + SyncManager::shared().configure(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption); #endif } diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 1e548f13..69520807 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -949,12 +949,13 @@ void RealmClass::create(ContextType ctx, ObjectType this_object, Arguments &a } bool update = false; + bool only_update_diff_objects = false; if (args.count == 3) { update = Value::validated_to_boolean(ctx, args[2], "update"); } NativeAccessor accessor(ctx, realm, object_schema); - auto realm_object = realm::Object::create(accessor, realm, object_schema, object, update); + auto realm_object = realm::Object::create(accessor, realm, object_schema, object, update, only_update_diff_objects); return_value.set(RealmObjectClass::create_instance(ctx, std::move(realm_object))); } diff --git a/src/js_sync.hpp b/src/js_sync.hpp index 569ad312..fafeca10 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -48,7 +48,7 @@ inline realm::SyncManager& syncManagerShared() { static std::once_flag flag; std::call_once(flag, [] { ensure_directory_exists_for_file(default_realm_file_directory()); - SyncManager::shared().configure_file_system(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption); + SyncManager::shared().configure(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption); }); return SyncManager::shared(); } diff --git a/src/object-store b/src/object-store index 362b8866..3253b505 160000 --- a/src/object-store +++ b/src/object-store @@ -1 +1 @@ -Subproject commit 362b886628b3aefc5b7a0bc32293d794dc1d4ad5 +Subproject commit 3253b5057573ee24e05d23b76505abb10e6deb32