Skip to content

fix(rivetkit-core): keep Date and Map action results for json and cbor clients - #6019

Closed
poojagosika wants to merge 1 commit into
rivet-dev:mainfrom
poojagosika:fix/action-output-cbor-tags
Closed

poojagosika wants to merge 1 commit into
rivet-dev:mainfrom
poojagosika:fix/action-output-cbor-tags

Conversation

@poojagosika

Copy link
Copy Markdown

Fixes #6018

rivetkit-core turned action results and event args into serde_json::Value for json and cbor clients. A Date (CBOR tag 1) or Map (tag 259) from the actor made that conversion fail, so the HTTP response carried null for the whole result and the WebSocket send failed (send_failed, events dropped).

  • CBOR HTTP responses now pass the result through as raw CBOR, the same as bare, so a cbor client gets the Date/Map back.
  • JSON responses (HTTP output, WebSocket ActionResponse.output, Event.args, error metadata) use a CBOR -> JSON conversion that handles tags the way JSON.stringify would: 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_json and encode_http_action_response: a record with createdAt: 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 to decode_cbor_json

@RivetAgent

Copy link
Copy Markdown
Contributor

The changes look good; no high-confidence bugs or CLAUDE.md compliance issues found.

  • Blocking: None.
  • Should-fix: None.
  • Nit: None.

Reviewed both changed files and the client serialization code. No CLAUDE.md files were present. GitHub authentication was unavailable, so PR status and prior Claude comments could not be verified.

Copy prompt to fix all
Fix all actionable findings in the latest Ironworks code review on PR rivet-dev/rivet#6019. Inspect every referenced location, address each finding without changing unrelated behavior, run the relevant tests, and summarize what changed.

@eersnington

Copy link
Copy Markdown
Member

closing since this is fixed 3572964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rivetkit: an action that returns a Date or Map gives json/cbor clients null (or send_failed), and events with them are dropped

3 participants