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-2841: Upgrade to Realm Core v14.11.0 #6739

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ realm.syncSession?.addProgressNotification(
(estimate) => console.log(`progress: ${estimate}/1.0`)
);
```
* It is no longer an error to set a base url for an App with a trailing slash - for example, `https://services.cloud.mongodb.com/` instead of `https://services.cloud.mongodb.com` - before this change that would result in a 404 error from the server. ([realm/realm-core#7791](https://github.com/realm/realm-core/pull/7791))
* Performance has been improved for range queries on integers and timestamps when using the `BETWEEN` operator. ([realm/realm-core#7785](https://github.com/realm/realm-core/pull/7785))
* On Windows devices Device Sync will additionally look up SSL certificates in the Windows Trusted Root Certification Authorities certificate store when establishing a connection. ([realm/realm-core#7882](https://github.com/realm/realm-core/pull/7882))
* Role and permissions changes no longer require a client reset to update the Realm on-device. ([realm/realm-core#7440](https://github.com/realm/realm-core/pull/7440))

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* None
* Opening an Flexible Sync Realm asynchronously may not wait to download all data. ([realm/realm-core#7720](https://github.com/realm/realm-core/issues/7720), since v10.12.0)
* Clearing a list of `mixed` in an upgraded file would lead to an assertion failing. ([realm/realm-core#7771](https://github.com/realm/realm-core/issues/7771), since 12.7.0-rc.0)
* Sync client can crash if a session is resumed while the session is being suspended. ([realm/realm-core#7860](https://github.com/realm/realm-core/issues/7860), since v10.18.0)
* If a sync session is interrupted by a disconnect or restart while downloading a bootstrap, stale data from the previous bootstrap may be included when the session reconnects and downloads the bootstrap. This can lead to objects stored in the database that do not match the actual state of the server and potentially leading to compensating writes. ([realm/realm-core#7827](https://github.com/realm/realm-core/issues/7827), since v10.18.0)
* Fixed unnecessary server roundtrips when there is no download to acknowledge. ([realm/realm-core#2129](https://jira.mongodb.org/browse/RCORE-2129), since v12.10.0)
* `Realm.App.Sync.SyncSession#uploadAllLocalChanges()` was inconsistent in how it handled commits which did not produce any changesets to upload. Previously it would sometimes complete immediately if all commits waiting to be uploaded were empty, and at other times it would wait for a server roundtrip. It will now always complete immediately. ([realm/realm-core#7796](https://github.com/realm/realm-core/pull/7796))
* `Realm#writeCopyTo()` on an encrypted Realm without explicitly specifying a new encryption key would only work if the old key happened to be a valid nul-terminated string. ([realm/realm-core#7842](https://github.com/realm/realm-core/issues/7842), since v12.10.0).
* You could get unexpected merge results when assigning to a nested collection. ([realm/realm-core#7809](https://github.com/realm/realm-core/issues/7809), since v12.7.0-rc.0)
* When `mapTo` is used to have an alias for a property name, `Realm.Results#sorted()` doesn't recognize the alias leading to errors like `Cannot sort on key path 'NAME': property 'PersonObject.NAME' does not exist`. ([#6779](https://github.com/realm/realm-js/issues/6779), since v11.2.0)

### Compatibility
* React Native >= v0.71.4
Expand All @@ -26,6 +37,7 @@ realm.syncSession?.addProgressNotification(
### Internal
* Adding a CallInvoker-based scheduler for Core on React Native and removing the "flush ui queue" workaround. ([#6791](https://github.com/realm/realm-js/pull/6791))
* Refactors throwing uncaught exceptions from callbacks dispatched onto the event loop from C++ on React Native. ([#6772](https://github.com/realm/realm-js/issues/6772))
* Upgraded Realm Core from v14.10.0 to v14.11.0. ([#6744](https://github.com/realm/realm-js/issues/6744)

## 12.11.1 (2024-06-25)

Expand Down
40 changes: 39 additions & 1 deletion integration-tests/tests/src/tests/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ describe("Results", () => {
static schema: Realm.ObjectSchema = {
name: "PersonObject",
properties: {
name: "string",
name: { type: "string", mapTo: "NAME" },
age: "double",
married: { type: "bool", default: false },
children: { type: "list", objectType: "PersonObject" },
Expand Down Expand Up @@ -535,6 +535,44 @@ describe("Results", () => {
realm.close();
});

it("sorted mapped a property", () => {
const realm = new Realm({ schema: [PersonObject] });
realm.write(function () {
realm.create("PersonObject", { name: "Ari", age: 10 });
realm.create("PersonObject", { name: "Tim", age: 11 });
realm.create("PersonObject", { name: "Bjarne", age: 12 });
realm.create("PersonObject", { name: "Alex", age: 12, married: true });
});

for (const propname of ["name", "NAME"]) {
const persons = realm.objects("PersonObject").sorted(propname);
expect(persons.length).equals(4);
expect(persons[0].name).equals("Alex");
expect(persons[0].age).equals(12);
}

realm.close();
});

it("sorted mapped a property in RQL", () => {
const realm = new Realm({ schema: [PersonObject] });
realm.write(function () {
realm.create("PersonObject", { name: "Ari", age: 10 });
realm.create("PersonObject", { name: "Tim", age: 11 });
realm.create("PersonObject", { name: "Bjarne", age: 12 });
realm.create("PersonObject", { name: "Alex", age: 12, married: true });
});

for (const propname of ["name", "NAME"]) {
const persons = realm.objects("PersonObject").filtered(`age > 0 SORT(${propname} ASC)`);
expect(persons.length).equals(4);
expect(persons[0].name).equals("Alex");
expect(persons[0].age).equals(12);
}

realm.close();
});

it("implements sorted correctly with all types", () => {
const realm = new Realm({ schema: [BasicTypesSchema] });
let objects = realm.objects<BasicTypesObject>("BasicTypesObject");
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/tests/src/tests/sync/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@

it("persists and encrypts a user", () => {
const encryptionKey = new ArrayBuffer(64);
const config: AppConfiguration = { id: "smurf", metadata: { mode: MetadataMode.Encryption, encryptionKey } };
// as metadata is cached within the same process, we need to use another app id
// see also https://github.com/realm/realm-core/issues/7876
const config: AppConfiguration = { id: "cryptosmurf", metadata: { mode: MetadataMode.Encryption, encryptionKey } };

Check failure on line 163 in integration-tests/tests/src/tests/sync/app.ts

View workflow job for this annotation

GitHub Actions / Lint

Replace `·id:·"cryptosmurf",·metadata:·{·mode:·MetadataMode.Encryption,·encryptionKey·}` with `⏎········id:·"cryptosmurf",⏎········metadata:·{·mode:·MetadataMode.Encryption,·encryptionKey·},⏎·····`
const app = new Realm.App(config);
expect(app).instanceOf(Realm.App);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/bindgen/vendor/realm-core
Submodule realm-core updated 123 files
Loading