Skip to content

Conversation

@rekhoff
Copy link
Contributor

@rekhoff rekhoff commented Mar 5, 2025

Description of Changes

Implements IComparable for Identity and ConnectionId

This relates to the following issue:
#2348

API and ABI breaking changes

Not a breaking change. Adds functionality and fixes bug.

Expected complexity level and risk

1

Testing

  1. Created a test project with a Rust server defining a table with a btree index like:
#[index(btree)]
pub identity: Identity,

and another where a table was defined with:
#[spacetimedb::table(name = period_timer, scheduled(period, at = scheduled_at), index(name = identity, btree(columns = [identity])))]
2. Published the server.
3. Created a C# client and generated the bindings.
4. Confirmed issue existed prior to change: IDE reports an error in the table definition of The type 'SpacetimeDB.Identity' must be convertible to 'System.IComparable<SpacetimeDB.Identity>' in order to use it as parameter 'Column' in the generic class 'SpacetimeDB.RemoteTableHandle<EventContext,Row>.BTreeIndexBase<Column>'
5. Made change contained in this PR.
6. Rebuilt SpacetimeDB executables, and C# SDK NuGet files.
7. Tested again by republishing and regenerating bindings.
8. Observed IDE no longer reports issue.

  • Tested IDE no longer reports error after change.

@rekhoff rekhoff requested a review from kazimuth March 6, 2025 01:32
@rekhoff rekhoff self-assigned this Mar 6, 2025
Copy link
Contributor

@kazimuth kazimuth left a comment

Choose a reason for hiding this comment

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

Could you add a basic test to BSATN.Runtime.Tests for these? With that I'm happy with this.

It would be nice to add a test to the SDK as well duplicating what you said you did in the PR description, but unfortunately that would require a PR in a different repo...

@rekhoff
Copy link
Contributor Author

rekhoff commented Mar 7, 2025

BSATN.Runtime.Tests added for both Identity and ConnectionId.
Marking as ready for merge.
This PR will resolve issue: #2348
New issue created for adding a test that performs the manually performed actions outlined in the description of this PR:
#2362

@rekhoff rekhoff added this pull request to the merge queue Mar 7, 2025
Merged via the queue into master with commit 7947a59 Mar 7, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants