SpacetimeDB
SpacetimeDB copied to clipboard
Fix fields named 'read'
Description of Changes
Fixes https://github.com/orgs/clockworklabs/projects/22?pane=issue&itemId=102392974&issue=clockworklabs%7Ccom.clockworklabs.spacetimedbsdk%7C276
by renaming internal static serializer fields so that they do not overlap with user-provided names.
Note, however, that some field names still will not work: ReadFields, WriteFields, Equals, and GetHashCode.
This would require a separate fix since the error would happen in a different place. In this case we would need to change the name of the generated member to something like ReadFields_ or Equals_, which I'm not sure is a good idea.
API and ABI breaking changes
N/A
Expected complexity level and risk
0
Testing
SDK tests and dotnet-verify tests are passing.
Note, however, that some field names still will not work:
ReadFields,WriteFields,Equals, andGetHashCode. This would require a separate fix since the error would happen in a different place. In this case we would need to change the name of the generated member to something likeReadFields_orEquals_, which I'm not sure is a good idea.
Makes sense. What do you think @jdetter?
I don't super care about Equals or HashCode because I don't think we want users overriding these anyway. I think we should fix the cases for ReadFields and WriteFields because I could easily see someone creating a table that has a column with those names. (e.g. if you made a permissions table or something)
@kazimuth @joshua-spacetime does that sound good?
@kazimuth Does this actually not have any API/ABI breaking changes? This doesn't require a C# SDK change?
Needs to be rebased once https://github.com/clockworklabs/SpacetimeDB/pull/2710 is merged, that's higher priority
Attempting to merge master with this PR ran into build issues, mostly due to conflicts with #2725 . I am working to resolve the conflicts and get another build going. I have an initial version ready that I need to test locally before pushing it to this PR.
After additional fixes, all tests pass. I have tested the most recent changes against BitCraft and other minor tests, without issue. I am making myself as an Assignee, due to the additional work. With that in mind, @jdetter would you mind reviewing/approving the changes?
Tested this change against the "fixture" test and adding the fields to a quickstart-chat project. Both succeeded (after a minor complication error that is now patched)