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-2739: Upgrade to Realm Core v14.1.0 #6512

Merged
merged 26 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
37 changes: 24 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
## vNext (TBD)

> [!NOTE]
> This version bumps the Realm file format to version 24. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Files created by Realm JavaScript prior to v6.0.0, might not be upgradeable. **Only Realm Studio 15.0.0 or later** will be able to open the new file format.

### Deprecations
* None

### Enhancements
* None
* Updated bundled OpenSSL version to 3.2.0. ([realm/realm-core#7303](https://github.com/realm/realm-core/pull/7303))
* 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))
* Querying a specific entry in a collection (in particular 'first and 'last') is supported. ([realm/realm-core#4269](https://github.com/realm/realm-core/issues/4269))
* Index on list of strings property now supported ([realm/realm-core#7142](https://github.com/realm/realm-core/pull/7142))
* 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))

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* None
* 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)
* Fixed equality queries on a `Mixed` property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. ([realm/realm-core#6407](https://github.com/realm/realm-core/issues/6407), since v10.5.0-beta.1)
* `@count`/`@size` is now supported for `Mixed` properties. ([realm/realm-core#7280](https://github.com/realm/realm-core/issues/7280), since v10.0.0)
* Fixed queries like `indexed_property == NONE {x}` which mistakenly matched on only `x` instead of not `x`. This only applies when an indexed property with equality (`==`, or `IN`) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. ([realm/realm-java#7862](https://github.com/realm/realm-java/issues/7862), since v10.20.0)
* Uploading the changesets recovered during an automatic client reset recovery may lead to `Bad server version` errors and a new client reset. ([realm/realm-core#7279](https://github.com/realm/realm-core/issues/7279), since v12.5.0)
* 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)).

### Compatibility
* React Native >= v0.71.4
* Realm Studio v14.0.0.
* File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).
* Realm Studio v15.0.0.
* File format: generates Realms with format v24 (reads and upgrades file format v10 or later).

### Internal
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->
* Upgraded Realm Core from v13.26.0 to v14.1.0. ([#6499](https://github.com/realm/realm-js/issues/6499))

## 12.6.2 (2024-03-04)

### Fixed
* Fixed binding abstraction to allow access of certain properties (`$$typeof` for now) prior to its injection. ([#6522](https://github.com/realm/realm-js/issues/6522), since v12.6.1)
* Added a missing dependency on `path-browserify`. ([#6522](https://github.com/realm/realm-js/issues/6522), since v12.6.1)

### Compatibility
* React Native >= v0.71.4
* Realm Studio v14.0.0.
* File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

### Internal
* Using Realm Core v13.26.0.

## 12.6.1 (2024-02-26)

Expand Down
Binary file modified integration-tests/assets/bundled.realm
Binary file not shown.
12 changes: 6 additions & 6 deletions integration-tests/tests/src/tests/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ describe("Queries", () => {
["Unsupported comparison between type", "boolCol == 0"],
["Unsupported comparison between type", "boolCol == 1"],
["Unsupported comparison between type", "boolCol == 'not a bool'"],
["Unsupported comparison between type", "boolCol == $0", "not a bool"],
["Cannot compare argument $0 with value", "boolCol == $0", "not a bool"],
["Unsupported comparison operator", "boolCol BEGINSWITH true"],
["Unsupported comparison operator", "boolCol CONTAINS true"],
["Unsupported comparison operator", "boolCol ENDSWITH true"],
Expand Down Expand Up @@ -363,7 +363,7 @@ describe("Queries", () => {
expectQueryException(this.realm, NullableTypesObject, [
["Unsupported comparison between type", "dateCol == 'not a date'"],
["Unsupported comparison between type", "dateCol == 1"],
["Unsupported comparison between type", "dateCol == $0", 1],
["Cannot compare argument $0 with value", "dateCol == $0", 1],
]);
});
});
Expand Down Expand Up @@ -401,7 +401,7 @@ describe("Queries", () => {
expectQueryException(this.realm, NullableTypesObject, [
["Unsupported comparison between type", "intCol == false"],
["Cannot convert", "intCol == 'not an int'"],
["Unsupported comparison between type", "intCol == $0", "not an int"],
["Cannot convert", "intCol == $0", "not an int"],
["Unsupported comparison operator", "intCol BEGINSWITH 1"],
["Unsupported comparison operator", "intCol CONTAINS 1"],
["Unsupported comparison operator", "intCol ENDSWITH 1"],
Expand Down Expand Up @@ -446,7 +446,7 @@ describe("Queries", () => {
expectQueryException(this.realm, NullableTypesObject, [
["Unsupported comparison between type", "floatCol == false"],
["Cannot convert", "floatCol == 'not a float'"],
["Unsupported comparison between type", "floatCol == $0", "not a float"],
["Cannot convert", "floatCol == $0", "not a float"],
["Unsupported comparison operator", "floatCol BEGINSWITH 1"],
["Unsupported comparison operator", "floatCol CONTAINS 1"],
["Unsupported comparison operator", "floatCol ENDSWITH 1"],
Expand Down Expand Up @@ -492,7 +492,7 @@ describe("Queries", () => {
expectQueryException(this.realm, NullableTypesObject, [
["Unsupported comparison between type", "doubleCol == false"],
["Cannot convert", "doubleCol == 'not a double'"],
["Unsupported comparison between type", "doubleCol == $0", "not a double"],
["Cannot convert", "doubleCol == $0", "not a double"],
["Unsupported comparison operator", "doubleCol BEGINSWITH 1"],
["Unsupported comparison operator", "doubleCol CONTAINS 1"],
["Unsupported comparison operator", "doubleCol ENDSWITH 1"],
Expand Down Expand Up @@ -557,7 +557,7 @@ describe("Queries", () => {
expectQueryException(this.realm, NullableTypesObject, [
["Unsupported comparison between type", "stringCol == true"],
["Unsupported comparison between type", "stringCol == 123"],
["Unsupported comparison operator", "stringCol CONTAINS $0", 1],
["Cannot compare argument $0 with value", "stringCol CONTAINS $0", 1],
]);
});
});
Expand Down
15 changes: 6 additions & 9 deletions integration-tests/tests/src/tests/shared-realms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import Realm, { List } from "realm";
import Realm from "realm";

import { openRealmBefore, openRealmBeforeEach } from "../hooks";
import { createLocalConfig } from "../utils/open-realm";
import { LogEntry } from "realm";

describe("SharedRealm operations", () => {
describe("logger", () => {
it("logger callback gets called", async function () {
type Log = {
message: string;
level: string;
};
let logs: Log[] = [];

Realm.setLogger((level, message) => {
logs.push({ level, message });
let logs: LogEntry[] = [];

Realm.setLogger((entry) => {
logs.push(entry);
});

Realm.setLogLevel("all");
Expand Down
10 changes: 7 additions & 3 deletions packages/realm/bindgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ if(DEFINED CMAKE_JS_VERSION)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if(NODE_ARCH STREQUAL "arm")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/realm-core/tools/cmake/armv7-linux-gnueabihf.toolchain.cmake")
add_link_options(-fuse-ld=bfd)
# due to how multiarch works in debian this is needed to link to the correct system libraries
set(CMAKE_IGNORE_PATH "/usr/lib/x86_64-linux-gnu")
elseif(NODE_ARCH STREQUAL "arm64")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/realm-core/tools/cmake/aarch64-linux-gnu.toolchain.cmake")
set(CMAKE_IGNORE_PATH "/usr/lib/x86_64-linux-gnu")
add_link_options(-fuse-ld=gold)
add_link_options(-Wl,-z,noexecstack)
add_link_options(-Wl,--warn-execstack)
elseif(NODE_ARCH STREQUAL "x64")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/realm-core/tools/cmake/x86_64-linux-gnu.toolchain.cmake")
add_link_options(-fuse-ld=gold)
add_link_options(-Wl,-z,noexecstack)
add_link_options(-Wl,--warn-execstack)
endif()
add_link_options(-fuse-ld=gold)
add_link_options(-Wl,-z,noexecstack)
add_link_options(-Wl,--warn-execstack)
kraenhansen marked this conversation as resolved.
Show resolved Hide resolved
endif()
endif()

Expand Down
7 changes: 6 additions & 1 deletion packages/realm/bindgen/js_opt_in_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,16 @@ classes:
- get_results_description
- feed_buffer
- make_ssl_verify_callback
- needs_file_format_upgrade

LogCategoryRef:
methods:
- set_default_level_threshold
- get_category

Logger:
methods:
- set_default_logger
- set_default_level_threshold

ConstTableRef:
methods:
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/bindgen/src/templates/jsi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ export function generate({ rawSpec, spec, file: makeFile }: TemplateContext): vo
extern "C" {
void realm_jsi_invalidate_caches() {
// Clear the default logger, to prevent it from holding on to a pointer that was released
realm::util::Logger::set_default_level_threshold(realm::util::Logger::Level::off);
realm::util::LogCategory::get_category(realm::util::LogCategory::realm.get_name()).set_default_level_threshold(realm::util::Logger::Level::off);
realm::util::Logger::set_default_logger(nullptr);
// Close all cached Realms
realm::_impl::RealmCoordinator::clear_all_caches();
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/bindgen/vendor/realm-core
Submodule realm-core updated 451 files
Loading
Loading