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

Fix for ChangeSetMergeTracker so that it correctly works with Value Types #940

Conversation

dwcullop
Copy link
Member

@dwcullop dwcullop commented Sep 6, 2024

Description

  • Addresses [Bug]: ReferenceEquals breaks value types #931 by fixing ChangeSetMergeTracker (the basis for multiple operators including MergeManyChangeSets, MergeChangeSets, and TransformManyAsync)
  • Replaces most instances of ReferenceEquals with EqualityComparer<T>.Default.Equals
  • A specific helper method was created to use when ReferenceEquals is explicitly needed (which will gracefully handle value types)
  • Added unit tests to verify the fix (tests failed without the additional changes)

Other Fixes

  • Updates ToObservableOptional with a more efficient implementation that does not use ReferenceEquals

@dwcullop dwcullop changed the title Fixes ChangeSetMergeTracker so that it correctly works with Value Types Fix for ChangeSetMergeTracker so that it correctly works with Value Types Sep 6, 2024
@dwcullop dwcullop self-assigned this Sep 6, 2024
@dwcullop dwcullop added the bug label Sep 6, 2024
@dwcullop dwcullop enabled auto-merge (squash) September 6, 2024 19:47
Copy link

@Al12rs Al12rs left a comment

Choose a reason for hiding this comment

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

Bump, for rebase and review, feedback above seems to have been addressed

@dwcullop
Copy link
Member Author

Sorry I was on vacation the past 10 days. It will now just use the given comparer or EqualityComparer.Default (if not provided).

@dwcullop dwcullop merged commit 9f934a2 into reactivemarbles:main Sep 16, 2024
1 check passed
@dwcullop dwcullop deleted the bugfix/referenceequals-breaks-value-types branch September 17, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants