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

[RNET-1121] Removed collection equality in RealmValue #3555

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

papafe
Copy link
Contributor

@papafe papafe commented Mar 12, 2024

Fixes #3552

TODO

  • Tests

@papafe papafe added the no-changelog Used to skip the changelog check label Mar 12, 2024
@papafe papafe requested a review from nirinchev March 12, 2024 14:57
@papafe papafe self-assigned this Mar 12, 2024
@@ -1533,8 +1533,6 @@ public bool Equals(RealmValue other)
RealmValueType.ObjectId => AsObjectId() == other.AsObjectId(),
RealmValueType.Guid => AsGuid() == other.AsGuid(),
RealmValueType.Object => AsIRealmObject().Equals(other.AsIRealmObject()),
RealmValueType.List => AsList().SequenceEqual(other.AsList()),
RealmValueType.Dictionary => AsDictionary().DictionaryEquals(other.AsDictionary()),
RealmValueType.Null => true,
Copy link
Member

Choose a reason for hiding this comment

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

This looks a bit suspicious 🤨

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Null part? It got me for a second too 😁
Before the switch we check that the type of the two RealmValues is the same. So if they're both null they're automatically equal.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, makes sense

@papafe papafe merged commit 0ed2b1d into main Mar 14, 2024
71 checks passed
@papafe papafe deleted the fp/remove-collection-equality branch March 14, 2024 09:31
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog Used to skip the changelog check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove equality for collections inside RealmValue
2 participants