From 7d1aff588e719a5f5931b7ffc5bcb5e08e833766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Mon, 19 Jun 2023 16:41:51 +0200 Subject: [PATCH 1/6] Upgrading Realm Core to v13.15.1 and removed "user" and "server" prefix from api key credentials --- CHANGELOG.md | 1 + packages/realm/bindgen/js_opt_in_spec.yml | 2 +- packages/realm/bindgen/vendor/realm-core | 2 +- packages/realm/src/app-services/Credentials.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c71b5d0557..d8ab7f76db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ * 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.13.0 to v13.15.1. ([#5909](https://github.com/realm/realm-js/pull/5909)) ## 12.0.0-alpha.2 (2023-04-05) 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)); } /** From dcb26357147e64e32ca72d5ab0e834ca6ddef26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Mon, 19 Jun 2023 21:25:34 +0200 Subject: [PATCH 2/6] Hoisting relevant changelog entries from Core --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ab7f76db..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,9 +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.13.0 to v13.15.1. ([#5909](https://github.com/realm/realm-js/pull/5909)) +* 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) From c6d87a812939a25d895487fe5b30979ebef2a3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 20 Jun 2023 07:08:18 +0200 Subject: [PATCH 3/6] Simply how to build for Linux (from #5870) --- .github/workflows/pr-realm-js.yml | 6 +++--- CMakeLists.txt | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-realm-js.yml b/.github/workflows/pr-realm-js.yml index 3799d21ab4..2fedfe69f8 100644 --- a/.github/workflows/pr-realm-js.yml +++ b/.github/workflows/pr-realm-js.yml @@ -50,9 +50,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 } diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b63d5a0a..2003a1aad3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,11 +19,9 @@ 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") # 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_IGNORE_PATH "/usr/lib/x86_64-linux-gnu") endif() add_link_options(-fuse-ld=gold) From e490b24b1d796f828bfc0829b1ce9f2c38ddf271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 20 Jun 2023 07:09:38 +0200 Subject: [PATCH 4/6] Set toolchains for Linux builds (from #5870) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2003a1aad3..293d87e40d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,10 +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/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-linux-gnu.toolchain.cmake") set(CMAKE_IGNORE_PATH "/usr/lib/x86_64-linux-gnu") + elseif(NODE_ARCH STREQUAL "x86_64") + 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) From 53217e375fac0276d298f6f591c06b78f459eb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 20 Jun 2023 07:10:02 +0200 Subject: [PATCH 5/6] PR feedback (from #5870) --- .github/workflows/pr-realm-js.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr-realm-js.yml b/.github/workflows/pr-realm-js.yml index 2fedfe69f8..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 @@ -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 From b9cea099593490e577b4c7a1552240d2cfd10734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 20 Jun 2023 07:29:08 +0200 Subject: [PATCH 6/6] Pick correct toolchain for Linux x86_64 builds (#5896) * Pick correct toolchain for Linux x86_64 builds --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 293d87e40d..263becfa11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ if(DEFINED CMAKE_JS_VERSION) elseif(NODE_ARCH STREQUAL "arm64") 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 "x86_64") + 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)