From 0a5764135d8ae4596703624246054083a68c5bb0 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:09:04 +0100 Subject: [PATCH 01/16] Updated core and a couple of fixes --- Tests/Realm.Tests/Database/CollectionTests.cs | 4 +++- Tests/Realm.Tests/Database/RealmResults/SortingTests.cs | 2 +- wrappers/realm-core | 2 +- wrappers/src/app_cs.cpp | 2 +- wrappers/src/shared_realm_cs.cpp | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Tests/Realm.Tests/Database/CollectionTests.cs b/Tests/Realm.Tests/Database/CollectionTests.cs index d1e14bdd1b..f1e158cdc7 100644 --- a/Tests/Realm.Tests/Database/CollectionTests.cs +++ b/Tests/Realm.Tests/Database/CollectionTests.cs @@ -1204,7 +1204,9 @@ public void QueryFilter_WithWrongArguments_ShouldThrow(StringQueryTestData data) }); var ex = Assert.Throws(() => _realm.All().Filter($"{data.PropertyName} = $0", data.NonMatchingValue))!; - Assert.That(ex.Message, Does.Contain($"Unsupported comparison")); + Assert.That(ex.Message, Does.Contain($"Cannot compare argument") + .Or.Contain("Unsupported comparison") + .Or.Contain("Cannot convert")); } [Test] diff --git a/Tests/Realm.Tests/Database/RealmResults/SortingTests.cs b/Tests/Realm.Tests/Database/RealmResults/SortingTests.cs index bea815ac36..4333db8a5a 100644 --- a/Tests/Realm.Tests/Database/RealmResults/SortingTests.cs +++ b/Tests/Realm.Tests/Database/RealmResults/SortingTests.cs @@ -348,7 +348,7 @@ public void SortsByAcceptedOrder() } }); var sortedCities = _realm.All().OrderBy(c => c.Name).ToList().Select(c => c.Name); - Assert.That(sortedCities, Is.EqualTo(new[] { "A-Place", "A Place", "Santo Domingo", "São Paulo", "Shanghai", "Sydney", "Åby" })); + Assert.That(sortedCities, Is.EqualTo(new[] { "A Place", "A-Place", "Santo Domingo", "Shanghai", "Sydney", "São Paulo", "Åby" })); } [TestCase(true)] diff --git a/wrappers/realm-core b/wrappers/realm-core index df25f80781..faf9c152af 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit df25f80781fbee4560bef9eeaaf993455be15047 +Subproject commit faf9c152af9449b622e28cc144c98ecda5faf656 diff --git a/wrappers/src/app_cs.cpp b/wrappers/src/app_cs.cpp index aae3cb6733..f95dd221e3 100644 --- a/wrappers/src/app_cs.cpp +++ b/wrappers/src/app_cs.cpp @@ -309,7 +309,7 @@ extern "C" { bool did_reset = false; while (!did_reset) { try { - app->sync_manager()->reset_for_testing(); + app->sync_manager()->tear_down_for_testing(); did_reset = true; } catch (...) { diff --git a/wrappers/src/shared_realm_cs.cpp b/wrappers/src/shared_realm_cs.cpp index 53dc338c9e..25661bfc71 100644 --- a/wrappers/src/shared_realm_cs.cpp +++ b/wrappers/src/shared_realm_cs.cpp @@ -97,7 +97,7 @@ namespace binding { class DotNetLogger : public Logger { protected: - void do_log(Level level, const std::string& message) override final + void do_log(const LogCategory& category, Level level, const std::string& message) override final { s_log_message(to_capi(message), level); } @@ -292,11 +292,11 @@ REALM_EXPORT void shared_realm_install_callbacks( realm::binding::s_can_call_managed = true; Logger::set_default_logger(std::make_shared()); - Logger::set_default_level_threshold(Logger::Level::info); + LogCategory::realm.set_default_level_threshold(Logger::Level::info); } REALM_EXPORT void shared_realm_set_log_level(Logger::Level level) { - Logger::set_default_level_threshold(level); + LogCategory::realm.set_default_level_threshold(level); } REALM_EXPORT SharedRealm* shared_realm_open(Configuration configuration, NativeException::Marshallable& ex) From 6057b25c41f56acdb65894aaa6b3c81224948408 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:39:36 +0100 Subject: [PATCH 02/16] Small corrections --- Tests/Realm.Tests/Database/NotificationTests.cs | 4 ++-- Tests/Realm.Tests/Database/RealmValueTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Realm.Tests/Database/NotificationTests.cs b/Tests/Realm.Tests/Database/NotificationTests.cs index 7a75955ebe..33a21b73c2 100644 --- a/Tests/Realm.Tests/Database/NotificationTests.cs +++ b/Tests/Realm.Tests/Database/NotificationTests.cs @@ -1593,7 +1593,7 @@ public void DictionaryOfObjects_SubscribeForNotifications_DoesntReceiveModificat dict.Clear(); }); - VerifyNotifications(changesets, expectedDeleted: new[] { 0 }, expectedCleared: false); + VerifyNotifications(changesets, expectedDeleted: new[] { 0 }, expectedCleared: true); } [Test] @@ -1641,7 +1641,7 @@ public void DictionaryOfPrimitives_SubscribeForNotifications_ShallowHasNoEffect( dict.Clear(); }); - VerifyNotifications(changesets, expectedDeleted: new[] { 0 }, expectedCleared: false); + VerifyNotifications(changesets, expectedDeleted: new[] { 0 }, expectedCleared: true); } #region Keypath filtering diff --git a/Tests/Realm.Tests/Database/RealmValueTests.cs b/Tests/Realm.Tests/Database/RealmValueTests.cs index d8fc5c1b44..cfcc7b3bd3 100644 --- a/Tests/Realm.Tests/Database/RealmValueTests.cs +++ b/Tests/Realm.Tests/Database/RealmValueTests.cs @@ -1161,7 +1161,7 @@ private static string ConvertRealmValueTypeToFilterAttribute(RealmValueType rvt) RealmValueType.Double => "double", RealmValueType.Decimal128 => "decimal", RealmValueType.ObjectId => "objectid", - RealmValueType.Object => "object", + RealmValueType.Object => "objectlink", RealmValueType.Guid => "uuid", _ => throw new NotImplementedException(), }; From c79f63d3a5a560a3449603e56ae8e0aa0a8d87ca Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:39:53 +0100 Subject: [PATCH 03/16] Updated dbs --- .../ForMigrationsToCopyAndMigrate.realm | Bin 8192 -> 8192 bytes .../Realm.Tests/EmbeddedResources/v6db.realm | Bin 1835008 -> 1835008 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Tests/Realm.Tests/EmbeddedResources/ForMigrationsToCopyAndMigrate.realm b/Tests/Realm.Tests/EmbeddedResources/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@JjgZgK$eY3>L!39`kOv7oLk$ zBgBGu3v$4lmTKC=3wl4Ol;NOKn4k*&Qei2P1GFo_R-;F<2Y=zj1};QU(oN{csf2Pk*yNqy=ZQT{4B*o6YTC-Y(abmd5$dvZL0)} zv6)yk-iXtDsbp8P*caFz1Njv56UpC-jEy2m0=9tPNbeV#Qpi>_8)-_kLz!uZkH5$6o=6@LD7(u3F)1r8ENsOs zBuh!poHKdNoZ_#TA^vN#=+|MzTs8Rzrgsg@AHjaNmrXO2DyF;?u^&X=$-a`>w)gt% zh_ zu;;Fo8B>^LSguvDiq?|ZHkVCeP7HdflEp7s-V{Pe`}a$`LX@qlRkvCe89yq-iWS)N zWz#$iZ*s?4wbre!KY+Zqtqp51KO{>2LpG>F-U{a)Cxeb=`;|u#WGuT#)@US?ektCa zDBxJpl6n5usBw56Hbyo$17?B}_H748fEFA9s(|kom9FU_bL4DCFVoJ7ZtW;v%U@6I z<4@SeL9wkB?1yOdniwfW2hBIz;f%Yn^ics8ej_a=s8E)ukw{z@`@>1bu_N*LA^Qgn zIfCbbW5$;%u0aN;G2vQdHveCQC-ONDDI>+8M_J%EX!M@E;9M@iBY$2uOyc`+hu*_@ z-WaJ1o#v-rcbqtV2ytq#IiR(lvCZb6Zkf)7+RG+=8<~CGWEG&$G@1KDlP%xGyIUrk z`WbQpZbU?;?AT|^c)u@oU3P`iWh&rj_WXO!mO zZkPweio#!Am{bc1R8pe(?hSK7Tp6br65UEKPo>mNBxs2| z$|jc3U^wNCcT+xNU&f)eLyp$G7ry!QnfWjF?W0Tx%6?16@xZ=&A^*~aya0%R1jv8_ zsDK89fFU3Z3Fn~Ca0Fw7EU9tk(7VqEGTp~1^?c> eG Date: Tue, 27 Feb 2024 15:32:03 +0100 Subject: [PATCH 04/16] Updated core to 14.0.1 and changelog --- CHANGELOG.md | 28 ++++++++++++++++++++++++---- wrappers/realm-core | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de0045eeaf..9df0682b1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ ## vNext (TBD) +**File format version bumped. Old files will be automatically upgraded but cannot be downgraded and opened with older versions of the .NET SDK.** + ### Breaking Changes * Added automatic serialization and deserialization of Realm classes when using methods on `MongoClient.Collection`, without the need to annotate classes with `MongoDB.Bson`attributes. This feature required to change the default serialization for various types (including `DateTimeOffset`). If you prefer to use the previous serialization, you need to call `Realm.SetLegacySerialization` before any kind of serialization is done, otherwise it may not work as epxected. [#3459](https://github.com/realm/realm-dotnet/pull/3459) +* Support for upgrading from Realm files produced by RealmCore v5.23.9 (Realm .NET v5.0.1) or earlier is no longer supported. (Core 14.0.0-beta.0) +* `String` and `byte[]` are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a `RealmValue` property, as now only strings will be returned. If searching for binary data is desired, then that type must be specified by the constant. In RQL (`.Filter()`) the new way to specify a binary constant is to use `RealmValueProp = bin('xyz')` or `RealmValueProp = binary('xyz')`. (Core 14.0.0-beta.0) +* Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (Core 14.0.0-beta.0) +* In RQL (`Filter()`), ff you want to query using `@type` operation, you must use `objectlink` to match links to objects. `object` is reserved for dictionary types. (Core 14.0.0) ### Enhancements * Add support for passing a key paths collection (`KeyPathsCollection`) when using `IRealmCollection.SubscribeForNotifications`. Passing a `KeyPathsCollection` allows to specify which changes in properties should raise a notification. @@ -11,7 +17,6 @@ - building it implicitly with the conversion from a `List` or array of `KeyPath` or strings; - getting one of the static values `Full` and `Shallow` for full and shallow notifications respectively. - For example: ```csharp var query = realm.All(); @@ -26,15 +31,30 @@ ``` (PR [#3501 ](https://github.com/realm/realm-dotnet/pull/3501)) * Added the `MongoClient.GetCollection` method to get a collection of documents from MongoDB that can be deserialized in Realm objects. This methods works the same as `MongoClient.GetDatabase(dbName).GetCollection(collectionName)`, but the database name and collection name are automatically derived from the Realm object class. [#3414](https://github.com/realm/realm-dotnet/pull/3414) +* Improved performance of RQL (`.Filter()`) queries on a non-linked string property using: >, >=, <, <=, operators and fixed behaviour that a null string should be evaulated as less than everything, previously nulls were not matched. (Core 13.27.0) +* Updated bundled OpenSSL version to 3.2.0. (Core 13.27.0) +* Storage of Decimal128 properties has been optimised so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. (Core 14.0.0-beta.0) +* Querying a specific entry in a collection (in particular 'first and 'last') is supported in RQL (`.Filter()`). (Core 14.0.0-beta.0) ### Fixed -* None +* Fixed RQL (`.Filter()`) queries like `indexed_property == NONE {x}` which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. (Core 13.27.0) +* Uploading the changesets recovered during an automatic client reset recovery may lead to 'Bad server version' errors and a new client reset. (Core 13.27.0) +* Fixed crash in fulltext index using prefix search with no matches. (Core 13.27.0) +* Fixed a crash with Assertion `failed: m_initiated` during sync session startup. (Core 13.27.0) +* Fixed a TSAN violation where the user thread could race to read m_finalized with the sync event loop. (Core 13.27.0) +* Fix a minor race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. (Core 13.27.0) +* Boolean property `ChangeSet.IsCleared` that is true when the collection gets cleared is now also raised for `IDictionary`, aligning it to `ISet` and `IList`. (Core 14.0.0-beta.0) +* Fixed equality queries on `RealmValue` properties with an index. (Core 14.0.0-beta.0) +* Fixed a crash that would happen when more than 8388606 were pointing to a specific object. +* Fixed wrong results when querying for `NULL` value in `IDictionary`. (Core 14.0.0-beta.0) +* A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). (Core 14.0.0-beta.0) + ### Compatibility -* Realm Studio: 13.0.0 or later. +* Realm Studio: 13.0.0 or later ?????????? TODO NEED TO CHECK --------------- ### Internal -* Using Core x.y.z. +* Using Core 14.0.1. ## 11.7.0 (2024-02-05) diff --git a/wrappers/realm-core b/wrappers/realm-core index faf9c152af..2bfd5e9ba7 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit faf9c152af9449b622e28cc144c98ecda5faf656 +Subproject commit 2bfd5e9ba74ed2620657bf968d2931f6ceab6785 From 3db20b5a0acd017f1dea320f679f5e054e6187f5 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:18:53 +0100 Subject: [PATCH 05/16] Added test for collection indexes --- Tests/Realm.Tests/Database/CollectionTests.cs | 127 ++++++++++++++++++ .../Database/RealmDictionaryTests.cs | 60 +++++++++ 2 files changed, 187 insertions(+) diff --git a/Tests/Realm.Tests/Database/CollectionTests.cs b/Tests/Realm.Tests/Database/CollectionTests.cs index f1e158cdc7..d375801a63 100644 --- a/Tests/Realm.Tests/Database/CollectionTests.cs +++ b/Tests/Realm.Tests/Database/CollectionTests.cs @@ -589,6 +589,73 @@ public void ListFilter_CanBeFilteredWithStringPredicate() Assert.That(rDogs.ElementAt(2).Name, Is.EqualTo("Rick")); } + [Test] + public void ListFilter_SupportsCollectionIndexes() + { + var joe = new Owner + { + Name = "Joe", + ListOfDogs = + { + new Dog { Name = "Fluffy" }, + new Dog { Name = "Plumpy" }, + } + }; + + var mark = new Owner + { + Name = "Mark", + ListOfDogs = + { + new Dog { Name = "Plumpy" }, + new Dog { Name = "Cuddly" }, + new Dog { Name = "Fluffy" }, + } + }; + + var anton = new Owner + { + Name = "Anton", + }; + + _realm.Write(() => + { + _realm.Add(joe); + _realm.Add(mark); + _realm.Add(anton); + }); + + var owners = _realm.All(); + + var query = owners.Filter("ListOfDogs[0].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(joe.Name)); + + query = owners.Filter("ListOfDogs[FIRST].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(joe.Name)); + + query = owners.Filter("ListOfDogs[LAST].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(mark.Name)); + + query = owners.Filter("ListOfDogs[LAST].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(mark.Name)); + + query = owners.Filter("ListOfDogs[*].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(2)); + Assert.That(query.ToArray().Select(p => p.Name).OrderBy(p => p), Is.EqualTo(new[] { joe.Name, mark.Name })); + + query = owners.Filter("ListOfDogs[SIZE] = $0", 0); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(anton.Name)); + + query = owners.Filter("ListOfDogs[SIZE] = $0", 3); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(mark.Name)); + } + [Test] public void ListFilter_WhenNotRealmList_Throws() { @@ -903,6 +970,66 @@ public void SetFilter_CanBeFilteredWithStringPredicate() Assert.That(rDogs.ElementAt(2).Name, Is.EqualTo("Rick")); } + [Test] + public void SetFilter_SupportsCollectionIndexes() + { + var joe = new Owner + { + Name = "Joe", + SetOfDogs = + { + new Dog { Name = "Fluffy" }, + new Dog { Name = "Plumpy" }, + } + }; + + var mark = new Owner + { + Name = "Mark", + SetOfDogs = + { + new Dog { Name = "Plumpy" }, + new Dog { Name = "Cuddly" }, + new Dog { Name = "Fluffy" }, + } + }; + + var anton = new Owner + { + Name = "Anton", + }; + + _realm.Write(() => + { + _realm.Add(joe); + _realm.Add(mark); + _realm.Add(anton); + }); + + var owners = _realm.All(); + + var query = owners.Filter("SetOfDogs[SIZE] = $0", 0); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(anton.Name)); + + query = owners.Filter("SetOfDogs[SIZE] = $0", 3); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(mark.Name)); + + query = owners.Filter("SetOfDogs[*].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(2)); + Assert.That(query.ToArray().Select(p => p.Name).OrderBy(p => p), Is.EqualTo(new[] { joe.Name, mark.Name })); + + Assert.That(() => owners.Filter("SetOfDogs[FIRST].Name = $0", "Fluffy"), Throws.TypeOf() + .And.Message.Contains("[FIRST] not expected")); + + Assert.That(() => owners.Filter("SetOfDogs[LAST].Name = $0", "Fluffy"), Throws.TypeOf() + .And.Message.Contains("[LAST] not expected")); + + Assert.That(() => owners.Filter("SetOfDogs[2].Name = $0", "Fluffy"), Throws.TypeOf() + .And.Message.Contains("[2] not expected")); + } + [Test] public void SetFilter_WhenNotRealmSet_Throws() { diff --git a/Tests/Realm.Tests/Database/RealmDictionaryTests.cs b/Tests/Realm.Tests/Database/RealmDictionaryTests.cs index 9508c967e7..0681d09fd0 100644 --- a/Tests/Realm.Tests/Database/RealmDictionaryTests.cs +++ b/Tests/Realm.Tests/Database/RealmDictionaryTests.cs @@ -1313,6 +1313,66 @@ public void DictionaryFilter_NoArguments_Throws() Throws.TypeOf().And.Message.Contains("Request for argument at index 0 but no arguments are provided")); } + [Test] + public void DictionaryFilter_SupportsCollectionIndexes() + { + var joe = new Owner + { + Name = "Joe", + DictOfDogs = + { + { "a", new Dog { Name = "Fluffy" } }, + { "b", new Dog { Name = "Plumpy" } }, + } + }; + + var mark = new Owner + { + Name = "Mark", + DictOfDogs = + { + { "a", new Dog { Name = "Plumpy" } }, + { "b", new Dog { Name = "Cuddly" } }, + { "c", new Dog { Name = "Fluffy" } }, + } + }; + + var anton = new Owner + { + Name = "Anton", + }; + + _realm.Write(() => + { + _realm.Add(joe); + _realm.Add(mark); + _realm.Add(anton); + }); + + var owners = _realm.All(); + + var query = owners.Filter("DictOfDogs[SIZE] = $0", 0); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(anton.Name)); + + query = owners.Filter("DictOfDogs[SIZE] = $0", 3); + Assert.That(query.Count, Is.EqualTo(1)); + Assert.That(query.Single().Name, Is.EqualTo(mark.Name)); + + query = owners.Filter("DictOfDogs[*].Name = $0", "Fluffy"); + Assert.That(query.Count, Is.EqualTo(2)); + Assert.That(query.ToArray().Select(p => p.Name).OrderBy(p => p), Is.EqualTo(new[] { joe.Name, mark.Name })); + + Assert.That(() => owners.Filter("DictOfDogs[FIRST].Name = $0", "Fluffy"), Throws.TypeOf() + .And.Message.Contains("[FIRST] not expected")); + + Assert.That(() => owners.Filter("DictOfDogs[LAST].Name = $0", "Fluffy"), Throws.TypeOf() + .And.Message.Contains("[LAST] not expected")); + + Assert.That(() => owners.Filter("DictOfDogs[2].Name = $0", "Fluffy"), Throws.TypeOf() + .And.Message.Contains("[2] not expected")); + } + private static void RunUnmanagedTests(Func> accessor, TestCaseData testData) { TestHelpers.RunAsyncTest(async () => From 82c6b5061433942a8824082709b1e7f478065d25 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:26:27 +0100 Subject: [PATCH 06/16] Updated changelog --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9df0682b1e..91622c95bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,27 @@ * Updated bundled OpenSSL version to 3.2.0. (Core 13.27.0) * Storage of Decimal128 properties has been optimised so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. (Core 14.0.0-beta.0) * Querying a specific entry in a collection (in particular 'first and 'last') is supported in RQL (`.Filter()`). (Core 14.0.0-beta.0) +* Add support for collection indexes in RQL (`Filter()`) queries. + For example: + ```csharp + var people = realm.All(); + + //People whose first dog is called "Fluffy" + var query1 = people.Filter("ListOfDogs[FIRST].Name = $0", "Fluffy") + + //People whose last dog is called "Fluffy" + var query2 = people.Filter("ListOfDogs[LAST].Name = $0", "Fluffy") + + //People whose second dog is called "Fluffy" + var query3 = people.Filter("ListOfDogs[2].Name = $0", "Fluffy") + + //People that have a dog called "Fluffy" + var query4 = people.Filter("ListOfDogs[*].Name = $0", "Fluffy") + + //People that have 3 dogs + var query5 = people.Filter("ListOfDogs[SIZE] = $0", 3) + ``` + (Core 14.0.0) ### Fixed * Fixed RQL (`.Filter()`) queries like `indexed_property == NONE {x}` which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. (Core 13.27.0) From ee596a5d21f516d9050df063203935059707b0a4 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:33:56 +0100 Subject: [PATCH 07/16] Fixed realm studio version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91622c95bc..73f05a0021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,7 @@ ### Compatibility -* Realm Studio: 13.0.0 or later ?????????? TODO NEED TO CHECK --------------- +* Realm Studio: 15.0.0 or later !!!!!!!!TODO NEED TO CHECK --------------- ### Internal * Using Core 14.0.1. From ef0075e1d94c3e2f1c8524ab9463dd860ae3b1ca Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:50:28 +0100 Subject: [PATCH 08/16] Updated guids to v24 --- .../Realm.Tests/EmbeddedResources/guids.realm | Bin 69632 -> 196608 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Tests/Realm.Tests/EmbeddedResources/guids.realm b/Tests/Realm.Tests/EmbeddedResources/guids.realm index cbe6aaf509b1b8431ae37205cb74b06567cc06a8..237805403b930c1b13e490268bca796ee4974cc9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g?}aEP3p~ zb}!@mh>urq7Kt1n#={hjs!kq}Vd>*#2u@IdqYUIRIKfRz6^keNK7~`NnC8x$N3y5+ zen+HF?>la==)3e!VSk=LE^!xJrtgYK;wlSWV?GBm!(j}6g0Igg)GhoAbb#b3NZV6A zOdV>B48gNvw^u36JSjws%yT&_`Z9u^MpC7|B&afo3?M^D2A5e-`xA)vXOI*!hxq+2 z4%3lFd}GBt(t{+BzR#gQSI0<1qKMAdZ(ZC+^`m+QDKbaLMv+M*i6jv1duF17MLzU0 z50LrO|EpDd+<-F+BN$J@EhE)31aC55gqu`w5&im)Bt;+oG)Co=)BFBXr{}NtTCp{- z9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Iza) m9Iza)9Iza)9Iza)9Iza)9Iza)9Iza)9Izbte>gCfX#Ed~5)0P= delta 166 zcmZo@;AvREBJm#zK5#KIfIx_@i<7uG17oAaQVB+G0hsU!wWsDmLM8^272jA-Hh7~$ HC#(tpl_W); From 26bfc485a67a58dab872f98772877eed96d670e6 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:18:44 +0100 Subject: [PATCH 09/16] Corrected methods --- Tests/Realm.Tests/Sync/SyncTestBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Realm.Tests/Sync/SyncTestBase.cs b/Tests/Realm.Tests/Sync/SyncTestBase.cs index a7826a2da8..57e862fcdb 100644 --- a/Tests/Realm.Tests/Sync/SyncTestBase.cs +++ b/Tests/Realm.Tests/Sync/SyncTestBase.cs @@ -275,7 +275,7 @@ protected PartitionSyncConfiguration GetFakeConfig(App? app = null, string? user if (setFakeSyncRoute) { - SetFakeSyncRoute(app); + SetFakeSyncRoute(user.App); } return UpdateConfig(new PartitionSyncConfiguration(Guid.NewGuid().ToString(), user, optionalPath)); @@ -288,7 +288,7 @@ protected FlexibleSyncConfiguration GetFakeFLXConfig(App? app = null, string? us if (setFakeSyncRoute) { - SetFakeSyncRoute(app); + SetFakeSyncRoute(user.App); } return UpdateConfig(new FlexibleSyncConfiguration(user, optionalPath)); From 28b8b886f3573ac78ad1828c7d2a008edd699ade Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:00:44 +0100 Subject: [PATCH 10/16] Corrected changelog and wrapper --- CHANGELOG.md | 1 + wrappers/src/app_cs.cpp | 20 ++++++-------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f05a0021..6af312891a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * `String` and `byte[]` are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a `RealmValue` property, as now only strings will be returned. If searching for binary data is desired, then that type must be specified by the constant. In RQL (`.Filter()`) the new way to specify a binary constant is to use `RealmValueProp = bin('xyz')` or `RealmValueProp = binary('xyz')`. (Core 14.0.0-beta.0) * Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (Core 14.0.0-beta.0) * In RQL (`Filter()`), ff you want to query using `@type` operation, you must use `objectlink` to match links to objects. `object` is reserved for dictionary types. (Core 14.0.0) +* Opening file with file format 23 (Realm .NET versions ealrier than 12.0.0) in read-only mode will crash. (Core 14.0.0) ### Enhancements * Add support for passing a key paths collection (`KeyPathsCollection`) when using `IRealmCollection.SubscribeForNotifications`. Passing a `KeyPathsCollection` allows to specify which changes in properties should raise a notification. diff --git a/wrappers/src/app_cs.cpp b/wrappers/src/app_cs.cpp index f95dd221e3..9820041e24 100644 --- a/wrappers/src/app_cs.cpp +++ b/wrappers/src/app_cs.cpp @@ -296,26 +296,18 @@ extern "C" { } REALM_EXPORT void shared_app_reset_for_testing(SharedApp& app) { + + if (!app->sync_manager()->get_logger()) { + return; + } + auto users = app->all_users(); for (size_t i = 0; i < users.size(); i++) { auto &user = users[i]; user->log_out(); } - while (app->sync_manager()->has_existing_sessions()) { - sleep_ms(5); - } - - bool did_reset = false; - while (!did_reset) { - try { - app->sync_manager()->tear_down_for_testing(); - did_reset = true; - } - catch (...) { - - } - } + app->sync_manager()->tear_down_for_testing(); App::clear_cached_apps(); } From 2479b2aacb1248fb70c3be6344884bf53b8ea35b Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:12:01 +0100 Subject: [PATCH 11/16] Added comments --- wrappers/src/app_cs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wrappers/src/app_cs.cpp b/wrappers/src/app_cs.cpp index 9820041e24..936ca73aa4 100644 --- a/wrappers/src/app_cs.cpp +++ b/wrappers/src/app_cs.cpp @@ -297,6 +297,7 @@ extern "C" { REALM_EXPORT void shared_app_reset_for_testing(SharedApp& app) { + // If the logger is empty then tear_down_for_testing has been called already if (!app->sync_manager()->get_logger()) { return; } @@ -307,6 +308,7 @@ extern "C" { user->log_out(); } + // This method will crash the application if called more than once for the same app. app->sync_manager()->tear_down_for_testing(); App::clear_cached_apps(); From 2a8e89eff9fc19f79c9c5e1eec3d46c8cd5fbf0b Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:21:57 +0100 Subject: [PATCH 12/16] Corrected changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6af312891a..372d5d4ff4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,6 @@ * Improved performance of RQL (`.Filter()`) queries on a non-linked string property using: >, >=, <, <=, operators and fixed behaviour that a null string should be evaulated as less than everything, previously nulls were not matched. (Core 13.27.0) * Updated bundled OpenSSL version to 3.2.0. (Core 13.27.0) * Storage of Decimal128 properties has been optimised so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. (Core 14.0.0-beta.0) -* Querying a specific entry in a collection (in particular 'first and 'last') is supported in RQL (`.Filter()`). (Core 14.0.0-beta.0) * Add support for collection indexes in RQL (`Filter()`) queries. For example: ```csharp @@ -67,7 +66,7 @@ * Fix a minor race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. (Core 13.27.0) * Boolean property `ChangeSet.IsCleared` that is true when the collection gets cleared is now also raised for `IDictionary`, aligning it to `ISet` and `IList`. (Core 14.0.0-beta.0) * Fixed equality queries on `RealmValue` properties with an index. (Core 14.0.0-beta.0) -* Fixed a crash that would happen when more than 8388606 were pointing to a specific object. +* Fixed a crash that would happen when more than 8388606 links were pointing to a specific object. * Fixed wrong results when querying for `NULL` value in `IDictionary`. (Core 14.0.0-beta.0) * A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). (Core 14.0.0-beta.0) From bf98fd4e9687c548965ecce4e1a9f67316618e32 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:25:13 +0100 Subject: [PATCH 13/16] Corrected changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 372d5d4ff4..c95a35f776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,8 @@ * Support for upgrading from Realm files produced by RealmCore v5.23.9 (Realm .NET v5.0.1) or earlier is no longer supported. (Core 14.0.0-beta.0) * `String` and `byte[]` are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a `RealmValue` property, as now only strings will be returned. If searching for binary data is desired, then that type must be specified by the constant. In RQL (`.Filter()`) the new way to specify a binary constant is to use `RealmValueProp = bin('xyz')` or `RealmValueProp = binary('xyz')`. (Core 14.0.0-beta.0) * Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (Core 14.0.0-beta.0) -* In RQL (`Filter()`), ff you want to query using `@type` operation, you must use `objectlink` to match links to objects. `object` is reserved for dictionary types. (Core 14.0.0) -* Opening file with file format 23 (Realm .NET versions ealrier than 12.0.0) in read-only mode will crash. (Core 14.0.0) +* In RQL (`Filter()`), if you want to query using `@type` operation, you must use `objectlink` to match links to objects. `object` is reserved for dictionary types. (Core 14.0.0) +* Opening realm with file format 23 or lower (Realm .NET versions earlier than 12.0.0) in read-only mode will crash. (Core 14.0.0) ### Enhancements * Add support for passing a key paths collection (`KeyPathsCollection`) when using `IRealmCollection.SubscribeForNotifications`. Passing a `KeyPathsCollection` allows to specify which changes in properties should raise a notification. From 2d04e6182255e3195f0e83a8f18ad6cbb88c5b7f Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:26:22 +0100 Subject: [PATCH 14/16] Updated core --- wrappers/realm-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/realm-core b/wrappers/realm-core index 2bfd5e9ba7..e1042b8504 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit 2bfd5e9ba74ed2620657bf968d2931f6ceab6785 +Subproject commit e1042b8504e277820f14cb884bd6ee5578ef8cb6 From b5d6e1d0bd7f796362825b8e6d4a600a34172519 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:29:12 +0100 Subject: [PATCH 15/16] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c95a35f776..7ab7432b8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,7 @@ * Realm Studio: 15.0.0 or later !!!!!!!!TODO NEED TO CHECK --------------- ### Internal -* Using Core 14.0.1. +* Using Core 14.1.0. ## 11.7.0 (2024-02-05) From c8c97ee03696c5b99da163fb526154f7d43ec5b7 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:08:17 +0100 Subject: [PATCH 16/16] Fixed changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab7432b8a..55cea6f908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,9 +70,8 @@ * Fixed wrong results when querying for `NULL` value in `IDictionary`. (Core 14.0.0-beta.0) * A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). (Core 14.0.0-beta.0) - ### Compatibility -* Realm Studio: 15.0.0 or later !!!!!!!!TODO NEED TO CHECK --------------- +* Realm Studio: 15.0.0 or later. ### Internal * Using Core 14.1.0.