-
Notifications
You must be signed in to change notification settings - Fork 494
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
State stores: conformace test to check special characters are not mangled #2910
State stores: conformace test to check special characters are not mangled #2910
Conversation
strings, written as is Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
2848d3a
to
a7ccf78
Compare
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
`JSONStringify` Signed-off-by: joshvanl <me@joshvanl.dev>
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.
What I am concerned with: is this going to cause backwards-incompatibility?
- What about reading values created with Dapr "vCurrent" using "vNext"?
- What about reading values created with Dapr "vNext" into "vCurrent"?
} | ||
} | ||
|
||
// Deprecated: use JSONStringify instead. |
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.
Should this be deleted then?
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.
It is still references in dapr/dapr
. We can remove once we have merged this, updated go mod and migrated the caller in dapr/dapr
state/in-memory/in_memory.go
Outdated
for _, o := range request.Operations { | ||
switch req := o.(type) { | ||
case *innerSetRequest: | ||
store.doSet(ctx, req.req.Key, req.data, req.ttl) | ||
err = errors.Join(err, store.doSet(ctx, req.req.Key, req.req.Value, req.ttl)) |
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.
Why the errors.Join here?
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.
We are inside a range, and want to catch all doSet
errors.
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.
However this is not really how errors.Join
should be used, as the Go team told me too: golang/go#60209
Should collect the errors in a slice and then call errors.Join
once
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.
Thanks 👍
This is a common debate of fixing a bug but having customers relying on the bug. We do have a way to workaround that, it is to bump the component version and keep the old version untouched. It would require to copy and paste the code and deprecate v1 of each component that has a breaking change. |
Even if we made a "v2", something I would consider a last-resort as it would double the maintenance burden on maintainers of this repo, we also need a solution for data that was already written. Otherwise, users (who, on average, never read docs, let alone changelogs ) will just switch "v1" to "v2" and then complain Dapr broke their data 🙃 @JoshVanL what are the "broken" components in 1.11.0? |
Some additional interesting findings. The interface in components accepts data as
This seems like it can cause a lot of inconsistencies also depending on how the data is stored and retrieved. Perhaps the problem isn't really having a v2 of components, but a v2 of the state store APIs that removes all these inconsistencies... |
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
@ItalyPaleAle I believe these would have been the broken ones https://github.com/dapr/components-contrib/actions/runs/5257496485 |
Signed-off-by: joshvanl <me@joshvanl.dev>
…/issues/60209b Signed-off-by: joshvanl <me@joshvanl.dev>
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Conformance test for all state stores to ensure that all state stores are able to store and return keys who's values are string which contain special characters.
Adds new
state/utils.JSONStringify
function for converting a[]byte
into a jsonified[]byte
string. Update state stores which were incorrectly encoding special characters in string state values on set.Question: Why are we doing anything to
Values
when Setting to state stores? Why do we not Set them as-is?