From e0e238918146ad3f5feefa18d14b843bc31c8b2b Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Tue, 18 Jun 2024 14:30:38 +0200 Subject: [PATCH 1/3] Use Core 14.10.1 --- CHANGELOG.md | 14 ++++++++++---- packages/realm_dart/src/realm-core | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 807b0d617..132cbd389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ ## vNext (TBD) ### Enhancements -* None +* Reduce the size of the local transaction log produced by creating objects, improving the performance of insertion-heavy transactions. (Core 14.10.0) +* Performance has been improved for range queries on integers and timestamps. Requires that you use the "BETWEEN" operation in `realm.query(...)`/`realm.all().query(...)`. (Core 14.10.1) ### Fixed -* None +* Fix some client resets (such as migrating to flexible sync) potentially failing with AutoClientResetFailed if a new client reset condition (such as rolling back a flexible sync migration) occurred before the first one completed. (Core 14.10.0) +* Encrypted files on Windows had a maximum size of 2GB even on x64 due to internal usage of `off_t`, which is a 32-bit type on 64-bit Windows. (Core 14.10.0) +* The encryption code no longer behaves differently depending on the system page size, which should entirely eliminate a recurring source of bugs related to copying encrypted Realm files between platforms with different page sizes. One known outstanding bug was ([RNET-1141](https://github.com/realm/realm-dotnet/issues/3592)), where opening files on a system with a larger page size than the writing system would attempt to read sections of the file which had never been written to. (Core 14.10.0) +* There were several complicated scenarios which could result in stale reads from encrypted files in multiprocess scenarios. These were very difficult to hit and would typically lead to a crash, either due to an assertion failure or DecryptionFailure being thrown. (Core 14.10.0) +* Tokenizing strings for full-text search could pass values outside the range [-1, 255] to `isspace()`, which is undefined behavior. (Core 14.10.0) +* Opening an FLX realm asynchronously may not wait to download all data. (Core 14.10.1) ### Compatibility * Realm Studio: 15.0.0 or later. @@ -69,7 +75,7 @@ ``` ### Fixed -* `Realm.writeAsync` did not handle async callbacks (`Future Function()`) correctly. (Issue [#1667](https://github.com/realm/realm-dart/issues/1667)) +* `Realm.writeAsync` did not handle async callbacks (`Future Function()`) correctly. (Issue [#1667](https://github.com/realm/realm-dart/issues/1667)) * Fixed an issue that would cause macOS apps to be rejected with `Invalid Code Signing Entitlements` error. (Issue [#1679](https://github.com/realm/realm-dart/issues/1679)) * Fixed a regression that makes it inconvenient to run unit tests using realm. (Issue [#1619](https://github.com/realm/realm-dart/issues/1619)) * After compacting, a file upgrade would be triggered. This could cause loss of data if schema mode is SoftResetFile (Core 14.9.0) @@ -81,7 +87,7 @@ * Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. ### Internal -* Using Core 14.9.0. +* Using Core 14.10.1. * Disabled codesigning of Apple binaries. (Issue [#1679](https://github.com/realm/realm-dart/issues/1679)) * Drop building xcframework for catalyst. (Issue [#1695](https://github.com/realm/realm-dart/issues/1695)) * Using xcode 15.4 for native build. (Issue [#1547](https://github.com/realm/realm-dart/issues/1547)) diff --git a/packages/realm_dart/src/realm-core b/packages/realm_dart/src/realm-core index f3d7ae5f9..058ecce71 160000 --- a/packages/realm_dart/src/realm-core +++ b/packages/realm_dart/src/realm-core @@ -1 +1 @@ -Subproject commit f3d7ae5f9f31d90b327a64536bb7801cc69fd85b +Subproject commit 058ecce712b4be8b2a2384ed893bf83d56a49fc0 From afb7882bb531c738e269d6c1c68d1c1d0c9b6928 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Mon, 24 Jun 2024 15:28:48 +0200 Subject: [PATCH 2/3] fix tests --- packages/realm_dart/test/client_reset_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/realm_dart/test/client_reset_test.dart b/packages/realm_dart/test/client_reset_test.dart index 5e76c177a..8b31a1ae6 100644 --- a/packages/realm_dart/test/client_reset_test.dart +++ b/packages/realm_dart/test/client_reset_test.dart @@ -147,7 +147,7 @@ void main() { await expectLater( clientResetFuture, throwsA(isA().having((e) => e.innerError?.toString(), 'innerError', 'Exception: This fails!').having((e) => e.toString(), 'message', - "ClientResetError message: A fatal error occurred during client reset: 'User-provided callback failed', inner error: 'Exception: This fails!'"))); + "ClientResetError message: A fatal error occurred during 'ClientReset' client reset for SyncClientResetRequired: Bad client file identifier (IDENT): 'User-provided callback failed', inner error: 'Exception: This fails!'"))); }); baasTest('$clientResetHandlerType.onManualResetFallback invoked when throw in onAfterReset', (appConfig) async { @@ -177,7 +177,7 @@ void main() { throwsA(isA().having((e) => e.innerError?.toString(), 'innerError', 'Exception: This fails too!').having( (e) => e.toString(), 'message', - "ClientResetError message: A fatal error occurred during client reset: 'User-provided callback failed', inner error: 'Exception: This fails too!'"))); + "ClientResetError message: A fatal error occurred during 'ClientReset' client reset for SyncClientResetRequired: Bad client file identifier (IDENT): 'User-provided callback failed', inner error: 'Exception: This fails too!'"))); }); baasTest('$clientResetHandlerType.onBeforeReset and onAfterReset are invoked', (appConfig) async { From 2b77af81437d6f38bf609d49bd323e7afa6ba7d2 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Mon, 24 Jun 2024 16:25:09 +0200 Subject: [PATCH 3/3] Fix compilation --- packages/ejson/lib/src/decoding.dart | 2 +- packages/ejson/lib/src/encoding.dart | 2 +- packages/ejson/pubspec.yaml | 4 ++-- packages/realm_common/pubspec.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ejson/lib/src/decoding.dart b/packages/ejson/lib/src/decoding.dart index d0c369c9d..f91549abb 100644 --- a/packages/ejson/lib/src/decoding.dart +++ b/packages/ejson/lib/src/decoding.dart @@ -243,7 +243,7 @@ UndefinedOr _decodeUndefinedOr(EJsonValue ejson) { Uuid _decodeUuid(EJsonValue ejson) { return switch (ejson) { - {'\$binary': {'base64': String s, 'subType': '04'}} => Uuid.fromBytes(base64.decode(s).buffer), + {'\$binary': {'base64': String s, 'subType': '04'}} => Uuid.fromBytes(base64.decode(s)), _ => raiseInvalidEJson(ejson), }; } diff --git a/packages/ejson/lib/src/encoding.dart b/packages/ejson/lib/src/encoding.dart index fd58b398a..cfe11b15d 100644 --- a/packages/ejson/lib/src/encoding.dart +++ b/packages/ejson/lib/src/encoding.dart @@ -117,7 +117,7 @@ EJsonValue _encodeSymbol(Symbol value) => {'\$symbol': value.name}; EJsonValue _encodeUndefined(Undefined undefined) => {'\$undefined': 1}; -EJsonValue _encodeUuid(Uuid uuid) => _encodeBinary(uuid.bytes.asUint8List(), subtype: '04'); +EJsonValue _encodeUuid(Uuid uuid) => _encodeBinary(uuid.bytes, subtype: '04'); EJsonValue _encodeBinary(Uint8List buffer, {required String subtype}) => { '\$binary': { diff --git a/packages/ejson/pubspec.yaml b/packages/ejson/pubspec.yaml index 02b1a68be..b02fdbecb 100644 --- a/packages/ejson/pubspec.yaml +++ b/packages/ejson/pubspec.yaml @@ -2,7 +2,7 @@ name: ejson description: >- EJSON serialization. - BSON is a binary format used to store JSON-like documents efficiently. + BSON is a binary format used to store JSON-like documents efficiently. EJSON extends JSON defining how all BSON types should be represented in JSON. topics: @@ -22,7 +22,7 @@ dependencies: collection: ^1.17.0 ejson_annotation: ^0.3.0 objectid: ^3.0.0 - sane_uuid: ^1.0.0-alpha.5 + sane_uuid: ^1.0.1 type_plus: ^2.0.0 dev_dependencies: diff --git a/packages/realm_common/pubspec.yaml b/packages/realm_common/pubspec.yaml index e97f238ed..800a577fe 100644 --- a/packages/realm_common/pubspec.yaml +++ b/packages/realm_common/pubspec.yaml @@ -15,7 +15,7 @@ environment: dependencies: collection: ^1.18.0 objectid: ^3.0.0 - sane_uuid: ^1.0.0-alpha.5 + sane_uuid: ^1.0.1 dev_dependencies: lints: ^3.0.0