-
Notifications
You must be signed in to change notification settings - Fork 665
Make ColumnIndexAttribute bitflags in the ABI #212
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
Conversation
As we're adding more variants, it's getting harder to keep track of the "A implies B" relationships between enum variants and to correctly do checks like "is this column autoinc" in different places. Using bitflags makes expressing those relationships more natural and checking simpler - e.g. you can just do `contains(AUTO_INC)` as a single bit operation instead of having to remember and list all possible variants that imply autoinc, especially if we're going to add more flags in the future. Initially I was going to make this change just in C# module generator and convert between ABI enum and bitflags over there, but it seems better to do this at ABI level so it simplifies Rust handling as well.
kulakowski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but I don't know when a good time for an ABI breaking change is right now.
|
We probably need to come up with some strategy to update C# dep when we change ABI. If this PR is merged now, that will make all the C# deps incompatible. The only way I can think of to avoid that would be to bump C# dep to I'm not sure what strategy is to update all of them together, in a way that ABI used by the website is compatible with that of the backend. |
This bumps C# dependency to be compatible with #212 when the next version of SpacetimeDB is released.
* Standalone guide * Several improvements * Title update * Updated nav.js * Guide updated * Small fix * Guide working again after `--root-dir` change * Finished + tested * Apply suggestions from code review * Updates after review * Update navigation * Apply suggestions from code review * Update docs/deploying/spacetimedb-standalone.md * Update docs/deploying/spacetimedb-standalone.md --------- Co-authored-by: John Detter <no-reply@boppygames.gg> Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
## Description of Changes `WithCredentials` was designed for our old auth model, where tokens were always issued by the SpacetimeDB host alongside an `Identity`, and therefore the bearer always knew their `Identity`. In our new auth model, a client may have a valid auth-able JWT but not know what `Identity` it will result in, as the `Identity` is computed based on the hash of some of the token's contents, and this hashing algorithm is not included in our client SDKs. As such, this PR revises `WithCredentials` to `WithToken`, which just accepts the token. ## API - [x] This is an API breaking change to the SDK *If the API is breaking, please state below what will break* `WithCredentials` is renamed and its signature changes. ## Requires SpacetimeDB PRs *List any PRs here that are required for this SDK change to work* ## Testsuite *If you would like to run the your SDK changes in this PR against a specific SpacetimeDB branch, specify that here. This can be a branch name or a link to a PR.* SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [ ] @cloutiertyler should test this with the Unity tutorial, if possible. --------- Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
## Description of Changes `WithCredentials` was designed for our old auth model, where tokens were always issued by the SpacetimeDB host alongside an `Identity`, and therefore the bearer always knew their `Identity`. In our new auth model, a client may have a valid auth-able JWT but not know what `Identity` it will result in, as the `Identity` is computed based on the hash of some of the token's contents, and this hashing algorithm is not included in our client SDKs. As such, this PR revises `WithCredentials` to `WithToken`, which just accepts the token. ## API - [x] This is an API breaking change to the SDK *If the API is breaking, please state below what will break* `WithCredentials` is renamed and its signature changes. ## Requires SpacetimeDB PRs *List any PRs here that are required for this SDK change to work* ## Testsuite *If you would like to run the your SDK changes in this PR against a specific SpacetimeDB branch, specify that here. This can be a branch name or a link to a PR.* SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [ ] @cloutiertyler should test this with the Unity tutorial, if possible. --------- Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Description of Changes
(This is reopened #72 with some fixes.)
As we're adding more variants, it's getting harder to keep track of the "A implies B" relationships between enum variants and to correctly do checks like "is this column autoinc" in different places.
Using bitflags makes expressing those relationships more natural and checking simpler - e.g. you can just do
contains(AUTO_INC)as a single bit operation instead of having to remember and list all possible variants that imply autoinc, especially if we're going to add more flags in the future.Initially I was going to make this change just in C# module generator and convert between ABI enum and bitflags over there, but it seems better to do this at ABI level so it simplifies Rust handling as well.
API
If the API is breaking, please state below what will break