From f2a89055534e69b984ae93a67e4cf2f646ef514f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 20 Jun 2023 10:33:19 +0200 Subject: [PATCH] Upgrade to Realm Core v13.15.1 (#5909) * Upgrading Realm Core to v13.15.1 and removed "user" and "server" prefix from api key credentials * Hoisting relevant changelog entries from Core * Simply how to build for Linux (from #5870) * Set toolchains for Linux builds (from #5870) * PR feedback (from #5870) * Pick correct toolchain for Linux x86_64 builds (#5896) * Pick correct toolchain for Linux x86_64 builds --- .github/workflows/pr-realm-js.yml | 10 ++++------ CHANGELOG.md | 7 ++++++- CMakeLists.txt | 6 ++++-- packages/realm/bindgen/js_opt_in_spec.yml | 2 +- packages/realm/bindgen/vendor/realm-core | 2 +- packages/realm/src/app-services/Credentials.ts | 2 +- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-realm-js.yml b/.github/workflows/pr-realm-js.yml index 3799d21ab4..8e8a9ebc3a 100644 --- a/.github/workflows/pr-realm-js.yml +++ b/.github/workflows/pr-realm-js.yml @@ -41,8 +41,6 @@ jobs: build: name: Build for ${{ matrix.variant.os }} ${{ matrix.variant.arch }} runs-on: ${{ matrix.variant.runner }} - # if container is not set for a variant, this is a noop - container: ${{ matrix.variant.container }} env: REALM_DISABLE_ANALYTICS: 1 NDK_VERSION: 23.1.7779620 @@ -50,9 +48,9 @@ jobs: fail-fast: false matrix: variant: - - { os: linux, runner: ubuntu-latest, arch: x64, artifact-path: packages/realm/prebuilds, test-node: true, test-electron: true, container: "ghcr.io/${{ github.repository }}/linux-x64:main" } - - { os: linux, runner: ubuntu-latest, arch: arm, artifact-path: packages/realm/prebuilds, container: "ghcr.io/${{ github.repository }}/linux-arm:main" } - - { os: linux, runner: ubuntu-latest, arch: arm64, artifact-path: packages/realm/prebuilds, container: "ghcr.io/${{ github.repository }}/linux-arm:main" } + - { os: linux, runner: ubuntu-latest, arch: x64, artifact-path: packages/realm/prebuilds, test-node: true, test-electron: true } + - { os: linux, runner: ubuntu-latest, arch: arm, artifact-path: packages/realm/prebuilds } + - { os: linux, runner: ubuntu-latest, arch: arm64, artifact-path: packages/realm/prebuilds } - { os: windows, runner: windows-latest, arch: x64, artifact-path: packages/realm/prebuilds, test-node: true, test-electron: true } - { os: windows, runner: windows-2019, arch: ia32, artifact-path: packages/realm/prebuilds } - { os: android, runner: ubuntu-latest, arch: x86_64, artifact-path: packages/realm/react-native/android/src/main/jniLibs } @@ -101,7 +99,7 @@ jobs: # On linux, electron requires a connected display. We fake this by giving it a headless environment using xvfb # Relevant issue: https://github.com/juliangruber/browser-run/issues/147 - name: Linux Environment setup - if: ${{ (matrix.variant.runner == 'ubuntu-latest') && (matrix.variant.container == '') }} + if: ${{ (matrix.variant.runner == 'ubuntu-latest') }} run: sudo apt-get install ccache ninja-build - name: Setup Java diff --git a/CHANGELOG.md b/CHANGELOG.md index c71b5d0557..d642c4aae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ // ... peopleOver20.unsubscribe(); ``` +* Support sort/distinct based on values from a dictionary e.g. `TRUEPREDICATE SORT(meta['age'])`. ([realm/realm-core#5311](https://github.com/realm/realm-core/pull/5311)) ### Fixed * Fix a stack overflow crash when using the query parser with long chains of AND/OR conditions. ([realm/realm-core#6428](https://github.com/realm/realm-core/pull/6428), since v10.11.0) @@ -50,6 +51,10 @@ * Performing a large number of queries without ever performing a write resulted in steadily increasing memory usage, some of which was never fully freed due to an unbounded cache. ([realm/realm-core#6530](https://github.com/realm/realm-core/pull/6530), since v10.19.0) * Partition-Based to Flexible Sync Migration for migrating a client app that uses partition based sync to use flexible sync under the hood if the server has been migrated to flexible sync is officially supported with this release. Any clients using an older version of Realm will receive a "switch to flexible sync" error message when trying to sync with the app. ([realm/realm-core#6554](https://github.com/realm/realm-core/issues/6554), since v11.9.0) * Fix deprecated namespace method warning when building for Android ([#5646](https://github.com/realm/realm-js/issues/5646)) +* Fixed a potential crash when opening the realm after failing to download a fresh FLX realm during an automatic client reset. ([realm/realm-core#6494](https://github.com/realm/realm-core/issues/6494), since v10.19.5) +* Changing parameters for a query after initialization could lead to a crash. ([realm/realm-core#6674](https://github.com/realm/realm-core/pull/6674), since v10.20.0) +* Querying with object list arguments now works as expected. ([realm/realm-core#6688](https://github.com/realm/realm-core/pull/6688), since v10.3.3) +* Fixed a crash when session multiplexing was enabled, caused by a use-after-free in SessionWrapper when tearing down sessions. ([realm/realm-core#6656](https://github.com/realm/realm-core/pull/6656), since v13.9.3) ### Compatibility * React Native >= v0.71.4 @@ -64,8 +69,8 @@ * Bump sync protocol to v9 to indicate client has fix for client reset error during async open. ([realm/realm-core#6609](https://github.com/realm/realm-core/issues/6609)) * Aligning analytics with other Realm SDKs. You can still disable the submission by setting environment variable `REALM_DISABLE_ANALYTICS`, and you can print out what is submitted by setting the environment variable `REALM_PRINT_ANALYTICS`. * Disabling sync session multiplexing by default in the SDK, since Core's default changed to enabled with v13.11.0. ([#5831](https://github.com/realm/realm-js/pull/5831)) -* Upgraded Realm Core from v13.11.1 to v13.13.0. ([#5873](https://github.com/realm/realm-js/pull/5873)) * Applied use of an opt-in list for Bindgen. ([#5820](https://github.com/realm/realm-js/pull/5820)) +* Upgraded Realm Core from v13.11.1 to v13.15.1. ([#5873](https://github.com/realm/realm-js/pull/5873) & [#5909](https://github.com/realm/realm-js/pull/5909)) ## 12.0.0-alpha.2 (2023-04-05) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b63d5a0a..263becfa11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,12 +19,14 @@ if(DEFINED CMAKE_JS_VERSION) endif() elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") if(NODE_ARCH STREQUAL "arm") - set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vendor/realm-core/tools/cmake/armhf.toolchain.cmake") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vendor/realm-core/tools/cmake/armv7-linux-gnueabihf.toolchain.cmake") # 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_SOURCE_DIR}/vendor/realm-core/tools/cmake/aarch64.toolchain.cmake") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vendor/realm-core/tools/cmake/aarch64-linux-gnu.toolchain.cmake") set(CMAKE_IGNORE_PATH "/usr/lib/x86_64-linux-gnu") + elseif(NODE_ARCH STREQUAL "x64") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vendor/realm-core/tools/cmake/x86_64-linux-gnu.toolchain.cmake") endif() add_link_options(-fuse-ld=gold) add_link_options(-Wl,-z,noexecstack) diff --git a/packages/realm/bindgen/js_opt_in_spec.yml b/packages/realm/bindgen/js_opt_in_spec.yml index 80904d80d4..06a7ac9ad6 100644 --- a/packages/realm/bindgen/js_opt_in_spec.yml +++ b/packages/realm/bindgen/js_opt_in_spec.yml @@ -382,7 +382,7 @@ classes: - custom - username_password - function - - user_api_key + - api_key SyncUser: methods: diff --git a/packages/realm/bindgen/vendor/realm-core b/packages/realm/bindgen/vendor/realm-core index 420cd996c1..f96a8c1b8f 160000 --- a/packages/realm/bindgen/vendor/realm-core +++ b/packages/realm/bindgen/vendor/realm-core @@ -1 +1 @@ -Subproject commit 420cd996c15c1861ba7c77bcf33433b36a292736 +Subproject commit f96a8c1b8f92882518978373d95f5ad699abc2f9 diff --git a/packages/realm/src/app-services/Credentials.ts b/packages/realm/src/app-services/Credentials.ts index 4974aeaae5..282624ba56 100644 --- a/packages/realm/src/app-services/Credentials.ts +++ b/packages/realm/src/app-services/Credentials.ts @@ -84,7 +84,7 @@ export class Credentials { * @return {Credentials} An instance of `Credentials` that can be used in {@link App.logIn}. */ static apiKey(key: string): Credentials { - return new Credentials(binding.AppCredentials.userApiKey(key)); + return new Credentials(binding.AppCredentials.apiKey(key)); } /**