Repository navigation
fix(rivetkit-core): keep Date and Map action results for json and cbor clients - #6019
Closed
poojagosika wants to merge 1 commit into
Closed
poojagosika wants to merge 1 commit into
poojagosika wants to merge 1 commit into
Conversation
Contributor
|
The changes look good; no high-confidence bugs or CLAUDE.md compliance issues found.
Reviewed both changed files and the client serialization code. No Copy prompt to fix all |
Member
|
closing since this is fixed 3572964 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6018
rivetkit-core turned action results and event args into
serde_json::Valuefor json and cbor clients. ADate(CBOR tag 1) orMap(tag 259) from the actor made that conversion fail, so the HTTP response carriednullfor the whole result and the WebSocket send failed (send_failed, events dropped).Date/Mapback.ActionResponse.output,Event.args, error metadata) use a CBOR -> JSON conversion that handles tags the wayJSON.stringifywould: tag 1 becomes an ISO string (1970-01-01T00:00:00.000Z), other tags use their content, map keys become strings, and byte strings use the client's["$Uint8Array", base64]form.Plain JSON values convert exactly as before.
Tested with unit tests on
decode_cbor_client_jsonandencode_http_action_response: a record withcreatedAt: Date, a float epoch, a tag-259 map and bytes converts as above for json, comes back unchanged for cbor, and plain JSON stays identical todecode_cbor_json