-
Notifications
You must be signed in to change notification settings - Fork 490
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
Mongo State: fix serialization value in the transaction method #3576
Conversation
776fbe3
to
b1bfd26
Compare
I tried this many times but something was always broken with serialization and didn't have time to further investigate. Mongo serialization is very very finnicky because BSON doesn't perfectly map to JSON and to Dapr's API. Make sure to run both certification tests and conformance tests after making any changes!
and also from the |
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.
Please add a test case in conformance tests that can execute this particular scenario / new code path added here.
Make sure that test doesn't break other components however.
https://github.com/dapr/components-contrib/blob/main/tests/conformance/state/state.go
About the test I did and were passed, in fact you can see the job in actions passed the test about confromance https://github.com/dapr/components-contrib/actions/runs/11499402962/job/32020955182?pr=3576 |
b1bfd26
to
a49eee8
Compare
@berndverst added the test in conformance |
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.
The conformance test breaks Redis state store. This is a good catch - that's what conformance tests are for after all.
If you have bandwidth, could you try to debug why this test fails for redis? I'm sure the fix for Redis 6 addresses this also for Redis 7.
Signed-off-by: Luigi Rende <[email protected]>
a49eee8
to
af8bd78
Compare
@berndverst I ran the tests locally and found that the issue with Redis 6 is related to the contentType I added in the Multi method. Specifically, the value stored in Redis is in Base64 format when the data request is represented as a byte array. I did a check in the response to decode the result and validate the content. As for Redis 7, when using the Multi method, the contentType is set to JSON; however, the version used in the conformance does not support this feature, in this case I have disabled the test and accept the test if the query feature is enabled. In fact in redis when the Json is a feature enabled the query api is active and however for Mongo this test is always done. |
@berndverst any feedback about the PR? |
@holopin-bot @luigirende Thank you! |
Congratulations @luigirende, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/cm487ck8q29050cjmqh36kpvg This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
Description
This PR to fix the issue about the serialization of the value in the transactional request when the contentType is equals to
application/json
as described in #3575Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #3575
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: