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

Start implementing IEquatable<Self> for all [SpacetimeDB.Type]s #2396

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kazimuth
Copy link
Contributor

@kazimuth kazimuth commented Mar 7, 2025

Description of Changes

Fixes issue identified in clockworklabs/com.clockworklabs.spacetimedbsdk#264 by implementing IEquatable<Self> for all [SpacetimeDB.Type]s in C#. Also overrides GetHashCode() and ToString() for these types, which should be helpful if users want to use them as hash map keys or print them.

WIP: Still need to handle some edge cases with nullable members and add more tests.

API and ABI breaking changes

Technically API breaking, since it is possible users manually implemented IEquatable somewhere.
It's an easy fix though.

Expected complexity level and risk

2: this is a slightly-tricky algorithm to implement due to some pitfalls in C#'s type system.

Testing

  • Get all C# module stuff compiling
  • Add equality proptests for a wide variety of types
  • Test that that SDK bug is fixed
  • Test quickstart-chat
  • Test blackholio

@kazimuth kazimuth added the abi-break A PR that makes an ABI breaking change label Mar 7, 2025
@kazimuth kazimuth self-assigned this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break A PR that makes an ABI breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant