From 4f1c608c29482651ee6ef9d102d0b4d8a6caa840 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Tue, 13 Jul 2021 18:04:22 +0200 Subject: [PATCH 1/7] Add EnumerableInterfaceImplementerSerializer to preserved BSON types --- Realm/Realm/Helpers/SerializationHelper.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Realm/Realm/Helpers/SerializationHelper.cs b/Realm/Realm/Helpers/SerializationHelper.cs index e26cce3883..b7f3795213 100644 --- a/Realm/Realm/Helpers/SerializationHelper.cs +++ b/Realm/Realm/Helpers/SerializationHelper.cs @@ -17,6 +17,7 @@ //////////////////////////////////////////////////////////////////////////// using System; +using System.Collections.Generic; using System.Linq; using MongoDB.Bson; using MongoDB.Bson.IO; @@ -99,6 +100,8 @@ internal static void PreserveSerializers() _ = new BsonArraySerializer(); _ = new ObjectSerializer(); + + _ = new EnumerableInterfaceImplementerSerializer, object>(); } public static string ToNativeJson(this object value) From b546d7c7ebfe83260eb5e6e26cf45a52b5e93ea1 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Wed, 14 Jul 2021 10:41:26 +0200 Subject: [PATCH 2/7] More missing fields --- Realm/Realm/Helpers/SerializationHelper.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Realm/Realm/Helpers/SerializationHelper.cs b/Realm/Realm/Helpers/SerializationHelper.cs index b7f3795213..6a69e978f0 100644 --- a/Realm/Realm/Helpers/SerializationHelper.cs +++ b/Realm/Realm/Helpers/SerializationHelper.cs @@ -102,6 +102,7 @@ internal static void PreserveSerializers() _ = new ObjectSerializer(); _ = new EnumerableInterfaceImplementerSerializer, object>(); + _ = new ExpandoObjectSerializer(); } public static string ToNativeJson(this object value) From e72388c0d8a021727193483619f9c2761e2ae9d6 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Thu, 15 Jul 2021 11:38:41 +0200 Subject: [PATCH 3/7] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 225a37326e..454354f022 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -160,6 +160,7 @@ * Fixes prior_size history corruption when replacing an embedded object in a list. (Core upgrade) * Fixed an assertion failure in the sync client when applying an AddColumn instruction for a RealmValue property when that property already exists locally. (Core upgrade) * Fixed an `Invalid data type` assertion failure in the sync client when applying an `AddColumn` instruction for a `RealmValue` property when that property already exists locally. (Core upgrade) +* [Unity] Preserved additional constructors necessary to serialize and deserialize Custom User Data. (PR [#2519](https://github.com/realm/realm-dotnet/pull/2519)) ### Enhancements * Added two extension methods on `IList` to get an `IQueryable` collection wrapping the list: From e1242e682cad1389992cb88a0c95a87bf20c8001 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Thu, 15 Jul 2021 13:13:18 +0200 Subject: [PATCH 4/7] Read more env vars --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a14dd1c80e..4174dec2cb 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -358,6 +358,12 @@ jobs: run: msbuild Realm/Realm.UnityUtils -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.UnityWeaver run: msbuild Realm/Realm.UnityWeaver -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} + - name: Read env vars + run: | + echo $GTIHUB_EVENET_PULL_REQUEST_HEAD_REF + echo ${{ github.event.pull_request.head.ref }} + echo $GITHUB_HEAD_REF + echo $GITHUB_BASE_REF - name: Find nupkg version id: find-nupkg-version run: | From 5258a03c29f22c40054dabb255e153ec08e89420 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Thu, 15 Jul 2021 13:20:36 +0200 Subject: [PATCH 5/7] Removed code meant for another branch --- .github/workflows/main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4174dec2cb..a14dd1c80e 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -358,12 +358,6 @@ jobs: run: msbuild Realm/Realm.UnityUtils -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.UnityWeaver run: msbuild Realm/Realm.UnityWeaver -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - - name: Read env vars - run: | - echo $GTIHUB_EVENET_PULL_REQUEST_HEAD_REF - echo ${{ github.event.pull_request.head.ref }} - echo $GITHUB_HEAD_REF - echo $GITHUB_BASE_REF - name: Find nupkg version id: find-nupkg-version run: | From 250fac329dddb447d5c50cce67b3f016a3cf7680 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Fri, 10 Sep 2021 18:13:43 +0200 Subject: [PATCH 6/7] Test with import for Unity --- Realm/Realm/Helpers/SerializationHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Realm/Realm/Helpers/SerializationHelper.cs b/Realm/Realm/Helpers/SerializationHelper.cs index 6a69e978f0..7fda1552cf 100644 --- a/Realm/Realm/Helpers/SerializationHelper.cs +++ b/Realm/Realm/Helpers/SerializationHelper.cs @@ -101,7 +101,7 @@ internal static void PreserveSerializers() _ = new ObjectSerializer(); - _ = new EnumerableInterfaceImplementerSerializer, object>(); + _ = new EnumerableInterfaceImplementerSerializer, object>(); _ = new ExpandoObjectSerializer(); } From ed101a5dcd66e1e664ce1be0133790bc5e33c547 Mon Sep 17 00:00:00 2001 From: Andrea Catalini Date: Tue, 26 Oct 2021 13:45:47 +0200 Subject: [PATCH 7/7] Move this issue's line to vNext --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 454354f022..0535da0e08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Fixed a bug that would result in a `RealmException` being thrown when opening a readonly Realm with schema that is a superset of the schema on disk. Now the code will just work and treat any classes not present in the on-disk schema to be treated as empty collections - e.g. `realm.All().Count == 0`. (Issue [#2619](https://github.com/realm/realm-dotnet/issues/2619)) * Fixed a bug that would create a "Documents" folder in the binary app folder when the ransomware protection in Windows is turned on. (Issue [#2685](https://github.com/realm/realm-dotnet/pull/2685)) * Fixed an issue that would cause incorrect property implementation to be generated if `PropertyChanged.Fody` runs after the Realm weaver. (Issue [#1873](https://github.com/realm/realm-dotnet/issues/1873)) +* [Unity] Preserved additional constructors necessary to serialize and deserialize Custom User Data. (PR [#2519](https://github.com/realm/realm-dotnet/pull/2519)) ### Compatibility * Realm Studio: 11.0.0 or later. @@ -160,7 +161,6 @@ * Fixes prior_size history corruption when replacing an embedded object in a list. (Core upgrade) * Fixed an assertion failure in the sync client when applying an AddColumn instruction for a RealmValue property when that property already exists locally. (Core upgrade) * Fixed an `Invalid data type` assertion failure in the sync client when applying an `AddColumn` instruction for a `RealmValue` property when that property already exists locally. (Core upgrade) -* [Unity] Preserved additional constructors necessary to serialize and deserialize Custom User Data. (PR [#2519](https://github.com/realm/realm-dotnet/pull/2519)) ### Enhancements * Added two extension methods on `IList` to get an `IQueryable` collection wrapping the list: