Skip to content

fix(rivetkit-core): keep cbor action args as raw CBOR - #6022

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

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

Conversation

@poojagosika

Copy link
Copy Markdown

Fixes #6021

With encoding: "cbor", rivetkit-core decoded action request args into serde_json::Value, which cannot hold a CBOR tag or byte string. An argument the client encodes as a tag (Uint8Array, Date, Map, Set) made the request fail with internal_error (HTTP) or invalid_request (WebSocket).

The cbor paths now decode args as ciborium::Value and re-encode them unchanged, so the actor receives exactly what the client sent:

  • ActorConnectActionRequestJson.args (only used by the cbor WebSocket path)
  • a new HttpActionRequestCbor for the cbor HTTP action path, with the same array / null / single-value handling as normalize_json_args

The json and bare paths are unchanged.

Tested with unit tests against decode_http_action_args and decode_actor_connect_message (a tag-64 byte string in args): both fail before this change and pass after; plain cbor args decode the same as before

This branch has not been deployed

No deployments
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 client: with encoding "cbor", actions fail with internal_error when an argument is a Uint8Array, Map or Date

1 participant