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

UNITY - Add missing BSON types to preserve list for Custom User Data #2519

Merged
merged 7 commits into from
Oct 26, 2021

Conversation

LaPeste
Copy link
Contributor

@LaPeste LaPeste commented Jul 13, 2021

Description

When tried Custom User data in Unity, 2 BSON types were not being preserved. This PR adds those 2 missing types

Fixes #
no issue was created for this

@LaPeste LaPeste changed the title Add EnumerableInterfaceImplementerSerializer to preserved BSON type Add missing BSON types to preserve list for Custom User Data Jul 14, 2021
@LaPeste LaPeste changed the title Add missing BSON types to preserve list for Custom User Data UNITY - Add missing BSON types to preserve list for Custom User Data Jul 14, 2021
@LaPeste LaPeste marked this pull request as ready for review July 14, 2021 14:34
@LaPeste LaPeste requested review from nirinchev, DominicFrei and papafe and removed request for nirinchev July 14, 2021 14:35
@LaPeste LaPeste force-pushed the ac/preserve-bson-enumerable branch from 41dfaeb to 99e9e1d Compare July 15, 2021 09:45
CHANGELOG.md Outdated Show resolved Hide resolved
@@ -99,6 +100,9 @@ internal static void PreserveSerializers()
_ = new BsonArraySerializer();

_ = new ObjectSerializer();

_ = new EnumerableInterfaceImplementerSerializer<IList<object>, object>();
_ = new ExpandoObjectSerializer();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What code did you write where the ExpandoObjectSerializer was needed? As far as I know, ExpandoObject is not supported on Unity, so I'm kind of surprised we ended up with a code path that reaches its serializer, although it's possible that it's just a fallback and the bson library uses it for non-expando objects as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll put the code in a repo for you to take a look.

@@ -99,6 +100,9 @@ internal static void PreserveSerializers()
_ = new BsonArraySerializer();

_ = new ObjectSerializer();

_ = new EnumerableInterfaceImplementerSerializer<IList<object>, object>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be EnumerableInterfaceImplementerSerializer<IEnumerable<object>, object> instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try it out and report back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct. It works with IEnumerable as well.

@nirinchev nirinchev marked this pull request as draft August 25, 2021 11:41
@nirinchev
Copy link
Member

@LaPeste let's merge this - I haven't had the time to test it, but I'm guessing it works.

@LaPeste LaPeste force-pushed the ac/preserve-bson-enumerable branch from 1654259 to 250fac3 Compare October 26, 2021 11:41
@cla-bot cla-bot bot added the cla: yes label Oct 26, 2021
@LaPeste LaPeste marked this pull request as ready for review October 26, 2021 11:46
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1385445790

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 82.265%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Realm/Realm/Helpers/SerializationHelper.cs 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
Realm/Realm/Helpers/SerializationHelper.cs 1 25.35%
Totals Coverage Status
Change from base Build 1381133582: -0.02%
Covered Lines: 5153
Relevant Lines: 6158

💛 - Coveralls

@LaPeste LaPeste merged commit 7fdf15a into master Oct 26, 2021
@LaPeste LaPeste deleted the ac/preserve-bson-enumerable branch October 26, 2021 14:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants