Skip to content
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

RJS-2771: Upgrade to Realm Core v14.4.0 #6569

Merged
merged 5 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Updated bundled OpenSSL version to 3.2.0. ([realm/realm-core#7303](https://github.com/realm/realm-core/pull/7303))
* Improved performance of object notifiers with complex schemas by ~20%. ([realm/realm-core#7424](https://github.com/realm/realm-core/pull/7424))
* Improved performance with very large number of notifiers by ~75%. ([realm/realm-core#7424](https://github.com/realm/realm-core/pull/7424))
* Improved performance of aggregate operations on Dictionaries of objects, particularly when the dictionaries are empty. ([realm/realm-core#7418](https://github.com/realm/realm-core/pull/7418)
* Property keypath in RQL can be substituted with value given as argument. Use `$P<i>` in query string. ([realm/realm-core#7033](https://github.com/realm/realm-core/issues/7033))
* You can now use query substitution for the `@type` argument. ([realm/realm-core#7289](https://github.com/realm/realm-core/issues/7289))
* Storage of `Decimal128` properties has been optimized so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. ([realm/realm-core#6111]https://github.com/realm/realm-core/pull/6111))
Expand All @@ -18,6 +19,7 @@
* You can set the threshold levels for trace output on individual categories. ([realm/realm-core#7004](https://github.com/realm/realm-core/pull/7004))
* Improved performance of RQL queries on a non-linked string property using `>`, `>=`, `<`, `<=` operators and fixed behavior that a null string should be evaluated as less than everything, previously nulls were not matched. ([realm/realm-core#3939](https://github.com/realm/realm-core/issues/3939))
* Added support for using aggregate operations on Mixed properties in queries. ([realm/realm-core#7398](https://github.com/realm/realm-core/pull/7398))
* Improved file compaction performance on platforms with page sizes greater than 4k (for example arm64 Apple platforms) for files less than 256 pages in size. ([realm/realm-core#7492](https://github.com/realm/realm-core/pull/7492))

### Fixed
* Aligned Dictionaries to Lists and Sets when they get cleared. ([#6205](https://github.com/realm/realm-core/issues/6205), since v10.3.0-rc.1)
Expand All @@ -28,16 +30,17 @@
* Fixed crash in full text index using prefix search with no matches ([realm/realm-core#7309](https://github.com/realm/realm-core/issues/7309), since v12.2.0)
* Fixed a race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. ([realm/realm-core#7341](https://github.com/realm/realm-core/pull/7341))
* Fixed a bug when removing items from a list that could result in invalidated links becoming visible which could cause crashes or exceptions when accessing those list items later on. This affects synced Realms where another client had previously removed a list with over 1000 items in it, and then further local removals from the same list caused the list to have fewer than 1000 items. ([#7414](https://github.com/realm/realm-core/pull/7414), since v10.0.0)
*

* Fixed opening a Realm with cached user while offline results in fatal error and session does not retry connection. ([#6554](https://github.com/realm/realm-js/issues/6554) and [#6558](https://github.com/realm/realm-js/issues/6558), since v12.6.0)
* Fixed sorting order of strings to use standard unicode codepoint order instead of grouping similar English letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". ([realm/realm-core#2573](https://github.com/realm/realm-core/issues/2573))
* `data` and `string` are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for `data` is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use `mixed = bin('xyz')` or `mixed = binary('xyz')`. ([realm/realm-core#6407](https://github.com/realm/realm-core/issues/6407))

### Compatibility
* React Native >= v0.71.4
* Realm Studio v15.0.0.
* File format: generates Realms with format v24 (reads and upgrades file format v10 or later).

### Internal
* Upgraded Realm Core from v13.26.0 to v14.2.0. ([#6499](https://github.com/realm/realm-js/issues/6499) and [#6541](https://github.com/realm/realm-js/issues/6541))
* Upgraded Realm Core from v13.26.0 to v14.4.0. ([#6499](https://github.com/realm/realm-js/issues/6499), [#6541](https://github.com/realm/realm-js/issues/6541), and [#6568](https://github.com/realm/realm-js/issues/6568))

## 12.6.2 (2024-03-04)

Expand Down
17 changes: 17 additions & 0 deletions packages/realm/bindgen/js_opt_in_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,30 @@ records:
- before_notify
- schema_did_change

ResumptionDelayInfo:
fields:
- max_resumption_delay_interval
- resumption_delay_interval
- resumption_delay_backoff_multiplier
- delay_jitter_divisor

SyncClientTimeouts:
fields:
- connect_timeout
- connection_linger_time
- ping_keepalive_period
- pong_keepalive_timeout
- fast_reconnect_limit
- reconnect_backoff_info

SyncClientConfig:
fields:
- base_file_path
- metadata_mode
- custom_encryption_key
- user_agent_binding_info
- multiplex_sessions
- timeouts

SyncError:
fields:
Expand Down
7 changes: 7 additions & 0 deletions packages/realm/bindgen/src/templates/jsi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ function convertPrimToJsi(addon: JsiAddon, type: string, expr: string): string {
case "uint64_t":
return `bigIntFromU64(_env, ${expr})`;

case "std::chrono::milliseconds":
return `bigIntFromU64(_env, std::chrono::milliseconds(${expr}).count())`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking more about this change. We should have been able to ignore this primitive all together, by simply not including it in the js_opt_in_spec.yml. Did bindgen fail if you didn't put this code in? If not - perhaps we should extend the "opt-in" feature to include primitives? What do you think @elle-j?


case "StringData":
case "std::string_view":
case "std::string":
Expand Down Expand Up @@ -333,6 +336,9 @@ function convertPrimFromJsi(addon: JsiAddon, type: string, expr: string): string
case "uint64_t":
return `bigIntToU64(_env, jsi::Value(_env, ${expr}))`;

case "std::chrono::milliseconds":
return `std::chrono::milliseconds(bigIntToU64(_env, jsi::Value(_env, ${expr})))`;

case "std::string":
return `(${expr}).asString(_env).utf8(_env)`;

Expand Down Expand Up @@ -1065,6 +1071,7 @@ export function generate({ rawSpec, spec, file: makeFile }: TemplateContext): vo

out(`
#include <jsi/jsi.h>
#include <chrono>
#include <realm_js_jsi_helpers.h>

namespace realm::js {
Expand Down
6 changes: 6 additions & 0 deletions packages/realm/bindgen/src/templates/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ function convertPrimToNode(addon: NodeAddon, type: string, expr: string): string
case "uint64_t":
return `Napi::BigInt::New(${env}, ${expr})`;

case "std::chrono::milliseconds":
return `Napi::Number::New(${env}, std::chrono::milliseconds(${expr}).count())`;

case "StringData":
case "std::string_view":
case "std::string":
Expand Down Expand Up @@ -280,6 +283,9 @@ function convertPrimFromNode(addon: NodeAddon, type: string, expr: string): stri
case "uint64_t":
return `extractUint64FromNode(${expr})`;

case "std::chrono::milliseconds":
return `std::chrono::milliseconds(extractUint64FromNode(${expr}))`;

case "std::string":
return `(${expr}).As<Napi::String>().Utf8Value()`;

Expand Down
1 change: 1 addition & 0 deletions packages/realm/bindgen/src/templates/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const PRIMITIVES_MAPPING: Record<string, string> = {
int32_t: "number",
count_t: "number",
uint64_t: "Int64",
"std::chrono::milliseconds": "Int64",
"std::string": "string",
"std::string_view": "string",
StringData: "string",
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/bindgen/vendor/realm-core
Submodule realm-core updated 91 files
+24 −0 .github/workflows/lock-threads.yml
+48 −0 CHANGELOG.md
+1 −1 Package.swift
+21 −1 bindgen/spec.yml
+3 −3 dependencies.yml
+15 −4 evergreen/config.yml
+13 −0 evergreen/install_baas.sh
+1 −1 external/catch
+25 −23 how-to-build.md
+11 −29 src/realm.h
+1 −1 src/realm/array_mixed.cpp
+30 −0 src/realm/collection.cpp
+59 −61 src/realm/collection.hpp
+59 −189 src/realm/collection_parent.cpp
+19 −26 src/realm/collection_parent.hpp
+22 −33 src/realm/dictionary.cpp
+20 −10 src/realm/dictionary.hpp
+1 −1 src/realm/group.cpp
+11 −47 src/realm/list.cpp
+19 −30 src/realm/list.hpp
+114 −32 src/realm/obj.cpp
+104 −58 src/realm/obj.hpp
+5 −0 src/realm/object-store/c_api/app.cpp
+0 −1 src/realm/object-store/c_api/list.cpp
+5 −9 src/realm/object-store/c_api/logging.cpp
+0 −38 src/realm/object-store/c_api/scheduler.cpp
+18 −0 src/realm/object-store/c_api/sync.cpp
+1 −1 src/realm/object-store/collection_notifications.hpp
+75 −46 src/realm/object-store/impl/collection_notifier.cpp
+12 −0 src/realm/object-store/impl/collection_notifier.hpp
+13 −25 src/realm/object-store/impl/list_notifier.cpp
+1 −0 src/realm/object-store/impl/list_notifier.hpp
+1 −10 src/realm/object-store/impl/object_notifier.cpp
+10 −30 src/realm/object-store/impl/results_notifier.cpp
+5 −7 src/realm/object-store/impl/transact_log_handler.cpp
+2 −7 src/realm/object-store/results.cpp
+62 −21 src/realm/object-store/sync/app.cpp
+4 −0 src/realm/object-store/sync/app.hpp
+10 −1 src/realm/object-store/sync/impl/sync_client.hpp
+27 −9 src/realm/object-store/sync/sync_manager.cpp
+21 −19 src/realm/object-store/sync/sync_manager.hpp
+55 −74 src/realm/object-store/sync/sync_session.cpp
+30 −5 src/realm/object-store/sync/sync_session.hpp
+2 −2 src/realm/object-store/util/scheduler.cpp
+3 −3 src/realm/object-store/util/scheduler.hpp
+3 −3 src/realm/object_converter.cpp
+15 −24 src/realm/path.hpp
+1 −1 src/realm/replication.cpp
+0 −26 src/realm/set.cpp
+12 −17 src/realm/set.hpp
+4 −1 src/realm/sync/client.cpp
+5 −6 src/realm/sync/client.hpp
+41 −0 src/realm/sync/instruction_applier.cpp
+4 −10 src/realm/sync/instruction_replication.cpp
+0 −2 src/realm/sync/instruction_replication.hpp
+1 −1 src/realm/sync/instructions.hpp
+32 −10 src/realm/sync/noinst/client_impl_base.cpp
+2 −1 src/realm/sync/noinst/client_impl_base.hpp
+81 −59 src/realm/sync/transform.cpp
+2 −2 src/realm/table.cpp
+5 −1 src/realm/table.hpp
+1 −1 src/realm/transaction.cpp
+6 −0 src/realm/util/logger.hpp
+1 −0 test/CMakeLists.txt
+13 −6 test/object-store/CMakeLists.txt
+1 −8 test/object-store/audit.cpp
+1 −4 test/object-store/benchmarks/client_reset.cpp
+1 −1 test/object-store/benchmarks/main.cpp
+60 −10 test/object-store/c_api/c_api.cpp
+0 −2 test/object-store/dictionary.cpp
+0 −1 test/object-store/nested_collections.cpp
+0 −1 test/object-store/object.cpp
+0 −1 test/object-store/primitive_list.cpp
+299 −217 test/object-store/sync/app.cpp
+2 −55 test/object-store/sync/client_reset.cpp
+1 −13 test/object-store/sync/flx_sync.cpp
+74 −1 test/object-store/test_runner.cpp
+330 −18 test/object-store/util/sync/baas_admin_api.cpp
+2 −25 test/object-store/util/sync/baas_admin_api.hpp
+36 −27 test/object-store/util/sync/sync_test_utils.cpp
+136 −4 test/object-store/util/sync/sync_test_utils.hpp
+47 −70 test/object-store/util/test_file.cpp
+18 −21 test/object-store/util/test_file.hpp
+2 −2 test/object-store/util/unit_test_transport.hpp
+1 −0 test/test_all.cpp
+1 −8 test/test_client_reset.cpp
+176 −0 test/test_list.cpp
+2 −2 test/test_parser.cpp
+2 −2 test/test_sync.cpp
+395 −0 test/test_transform.cpp
+1,457 −0 test/test_transform_collections_mixed.cpp
Loading