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

RDART-1071: Fix between query bug #1770

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@
* Added a new parameter of type `SyncTimeoutOptions` to `AppConfiguration`. It allows users to control sync timings, such as ping/pong intervals as well various connection timeouts. (Issue [#1763](https://github.com/realm/realm-dart/issues/1763))
* Added a new parameter `cancelAsyncOperationsOnNonFatalErrors` on `Configuration.flexibleSync` that allows users to control whether non-fatal errors such as connection timeouts should be surfaced in the form of errors or if sync should try and reconnect in the background. (PR [#1764](https://github.com/realm/realm-dart/pull/1764))
* Allow nullable and other optional fields to be absent in EJson, when deserializing realm objects. (Issue [#1735](https://github.com/realm/realm-dart/issues/1735))
* Sync log statements now include the app services connection id in their prefix (e.g `Connection[1:<connection id>] Session[1]: log message`) to make correlating sync activity to server logs easier during troubleshooting (Core 14.11.2).
* Improve sync bootstrap performance by reducing the number of table selections in the replication logs for embedded objects. (Core v14.11.2-8-g430a044fe)
* Released a read lock which was pinned for the duration of a mutable subscription even after commit. This frees resources earlier, and may improve performance of sync bootstraps where the starting state is large. (Core v14.11.2-8-g430a044fe)
* Client reset cycle detection now checks if the previous recovery attempt was made by the same core version, and if not attempts recovery again (Core v14.11.2-8-g430a044fe).

### Fixed
* Fixed an issue where creating a flexible sync configuration with an embedded object not referenced by any top-level object would throw a "No such table" exception with no meaningful information about the issue. Now a `RealmException` will be thrown that includes the offending object name, as well as more precise text for what the root cause of the error is. (PR [#1748](https://github.com/realm/realm-dart/pull/1748))
* `AppConfiguration.maxConnectionTimeout` never had any effect and has been deprecated in favor of `SyncTimeoutOptions.connectTimeout`. (PR [#1764](https://github.com/realm/realm-dart/pull/1764))
* Pure dart apps, when compiled to an exe and run from outside the project directory would fail to load the native shared library. (Issue [#1765](https://github.com/realm/realm-dart/issues/1765))
* App subscription callback was getting fired before the user profile was retrieved on login, leading to an empty user profile when using the callback. (Core 14.11.1)
nielsenko marked this conversation as resolved.
Show resolved Hide resolved
* Sync client may report duplicate compensating write errors (Core 14.11.2).
* String serialization of timestamps with a sufficiently large timestamp value could overflow an int causing undefined behavior, causing potentially bad values for the month/day/year values in stringified dates. (Core 14.11.2).
nielsenko marked this conversation as resolved.
Show resolved Hide resolved
* Fixed an "invalid column key" exception when using a RQL "BETWEEN" query on an int or timestamp property across links. (Core v14.11.2-8-g430a044fe)

### Compatibility
* Realm Studio: 15.0.0 or later.
Expand Down
2 changes: 1 addition & 1 deletion packages/realm_dart/lib/realm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// dart.library.cli is available only on dart desktop
export 'src/realm_flutter.dart' if (dart.library.cli) 'src/realm_dart.dart';
export 'package:ejson/ejson.dart';
export 'package:ejson/ejson.dart';
2 changes: 1 addition & 1 deletion packages/realm_dart/src/realm-core
Submodule realm-core updated 96 files
+70 −1 CHANGELOG.md
+1 −2 Package.swift
+174 −174 certificate-authority/certs/dns-chain.crt.pem
+76 −76 certificate-authority/certs/dns-checked-server.crt.pem
+13 −13 certificate-authority/certs/dns-checked-server.csr.pem
+26 −26 certificate-authority/certs/dns-checked-server.key.pem
+175 −175 certificate-authority/certs/ip-chain.crt.pem
+77 −77 certificate-authority/certs/ip-server.crt.pem
+13 −13 certificate-authority/certs/ip-server.csr.pem
+26 −26 certificate-authority/certs/ip-server.key.pem
+ certificate-authority/certs/localhost-chain.crt.cer
+174 −174 certificate-authority/certs/localhost-chain.crt.pem
+76 −76 certificate-authority/certs/localhost-server.crt.pem
+15 −15 certificate-authority/certs/localhost-server.csr.pem
+26 −26 certificate-authority/certs/localhost-server.key.pem
+97 −97 certificate-authority/root-ca/crt.pem
+24 −24 certificate-authority/root-ca/csr.pem
+1 −1 certificate-authority/root-ca/db/ca.crt.srl
+2 −0 certificate-authority/root-ca/db/ca.db
+50 −50 certificate-authority/root-ca/key.pem
+98 −98 certificate-authority/signing-ca/crt.pem
+25 −25 certificate-authority/signing-ca/csr.pem
+1 −1 certificate-authority/signing-ca/db/ca.crt.srl
+3 −0 certificate-authority/signing-ca/db/ca.db
+50 −50 certificate-authority/signing-ca/key.pem
+1 −1 dependencies.yml
+171 −15 evergreen/config.yml
+3 −3 src/realm/alloc_slab.hpp
+0 −3 src/realm/error_codes.h
+24 −8 src/realm/object-store/sync/app.cpp
+2 −0 src/realm/object-store/sync/app.hpp
+1 −1 src/realm/parser/driver.cpp
+12 −30 src/realm/query_conditions.hpp
+49 −45 src/realm/replication.cpp
+18 −15 src/realm/replication.hpp
+1 −2 src/realm/sync/CMakeLists.txt
+47 −153 src/realm/sync/client.cpp
+0 −8 src/realm/sync/client_base.hpp
+2 −2 src/realm/sync/instruction_applier.cpp
+1 −24 src/realm/sync/network/default_socket.cpp
+0 −9 src/realm/sync/network/websocket.cpp
+0 −3 src/realm/sync/network/websocket_error.hpp
+8 −9 src/realm/sync/noinst/client_history_impl.cpp
+4 −3 src/realm/sync/noinst/client_history_impl.hpp
+35 −90 src/realm/sync/noinst/client_impl_base.cpp
+26 −21 src/realm/sync/noinst/client_impl_base.hpp
+10 −14 src/realm/sync/noinst/client_reset.cpp
+1 −6 src/realm/sync/noinst/client_reset.hpp
+2 −3 src/realm/sync/noinst/client_reset_operation.cpp
+1 −2 src/realm/sync/noinst/client_reset_operation.hpp
+0 −431 src/realm/sync/noinst/compact_changesets.cpp
+0 −41 src/realm/sync/noinst/compact_changesets.hpp
+2 −2 src/realm/sync/noinst/migration_store.cpp
+29 −34 src/realm/sync/noinst/pending_bootstrap_store.cpp
+9 −13 src/realm/sync/noinst/pending_bootstrap_store.hpp
+51 −138 src/realm/sync/noinst/pending_reset_store.cpp
+7 −13 src/realm/sync/noinst/pending_reset_store.hpp
+4 −1 src/realm/sync/noinst/protocol_codec.cpp
+5 −29 src/realm/sync/noinst/server/server.cpp
+0 −5 src/realm/sync/noinst/server/server.hpp
+1 −38 src/realm/sync/noinst/server/server_history.cpp
+1 −5 src/realm/sync/noinst/server/server_history.hpp
+36 −28 src/realm/sync/noinst/sync_metadata_schema.cpp
+5 −2 src/realm/sync/noinst/sync_metadata_schema.hpp
+202 −123 src/realm/sync/subscriptions.cpp
+43 −13 src/realm/sync/subscriptions.hpp
+1 −1 src/realm/util/file.cpp
+5 −0 src/realm/util/logger.hpp
+6 −6 src/realm/util/serializer.cpp
+0 −1 test/CMakeLists.txt
+62 −1 test/object-store/sync/app.cpp
+3 −3 test/object-store/sync/client_reset.cpp
+6 −3 test/object-store/sync/flx_role_change.cpp
+32 −24 test/object-store/sync/flx_schema_migration.cpp
+170 −16 test/object-store/sync/flx_sync.cpp
+54 −4 test/object-store/util/sync/baas_admin_api.cpp
+9 −1 test/object-store/util/sync/baas_admin_api.hpp
+282 −0 test/object-store/util/sync/redirect_server.hpp
+2 −2 test/object-store/util/sync/sync_test_utils.cpp
+7 −1 test/object-store/util/test_file.cpp
+2 −1 test/object-store/util/test_file.hpp
+0 −11 test/peer.hpp
+0 −3 test/sync_fixtures.hpp
+1 −1 test/test_alloc.cpp
+100 −138 test/test_client_reset.cpp
+0 −438 test/test_compact_changesets.cpp
+0 −12 test/test_embedded_objects.cpp
+35 −0 test/test_parser.cpp
+426 −37 test/test_replication.cpp
+2 −3 test/test_sync.cpp
+28 −23 test/test_sync_pending_bootstraps.cpp
+261 −77 test/test_sync_subscriptions.cpp
+0 −6 test/test_transform.cpp
+2 −2 test/util/CMakeLists.txt
+14 −0 test/util/unit_test.hpp
+88 −44 tools/cross_compile.sh
14 changes: 14 additions & 0 deletions packages/realm_dart/test/results_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1550,4 +1550,18 @@ void main() {
expect(results.skip(2), results.toList().sublist(2));
expect(results.skip(2).take(3), [results[2], results[3], results[4]]);
});

test('BETWEEN op', () {
final realm = getRealm(Configuration.local([Friend.schema, Party.schema]));

final alice = Friend('alice', age: 36);
final bob = Friend('bob', age: 49, bestFriend: alice);
alice.bestFriend = bob;

realm.write(() => realm.addAll([alice, bob]));

expect(realm.query<Friend>(r'age BETWEEN {$0, $1}', [20, 40]), [alice]);
// the following used to fail due to: https://github.com/realm/realm-core/issues/7935
expect(realm.query<Friend>(r'bestFriend.age BETWEEN {$0, $1}', [20, 40]), [bob]);
});
}
3 changes: 3 additions & 0 deletions packages/realm_dart/test/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ class _Friend {
var age = 42;
_Friend? bestFriend;
final friends = <_Friend>[];

@override
String toString() => '$name $age';
}

@RealmModel()
Expand Down
Loading