Skip to content

fix(rivetkit): treat empty actor input bytes as absent - #5529

Closed
abcxff wants to merge 1 commit into
stack/fix-sdks-drop-rivet-util-metrics-dep-from-protocol-crates-to-unlink-rocksdb-woolkmvtfrom
stack/fix-rivetkit-treat-empty-actor-input-bytes-as-absent-ouvoqtns
Closed

fix(rivetkit): treat empty actor input bytes as absent#5529
abcxff wants to merge 1 commit into
stack/fix-sdks-drop-rivet-util-metrics-dep-from-protocol-crates-to-unlink-rocksdb-woolkmvtfrom
stack/fix-rivetkit-treat-empty-actor-input-bytes-as-absent-ouvoqtns

Conversation

@abcxff

@abcxff abcxff commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@railway-app

railway-app Bot commented Jul 31, 2026

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-5529 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud 😴 Sleeping (View Logs) Web Aug 7, 2026 at 1:13 am
website 😴 Sleeping (View Logs) Web Aug 2, 2026 at 7:07 pm
kitchen-sink 😴 Sleeping (View Logs) Web Aug 2, 2026 at 7:58 am
frontend-inspector 😴 Sleeping (View Logs) Web Aug 2, 2026 at 7:30 am
ladle ✅ Success (View Logs) Web Jul 31, 2026 at 4:13 am
mcp-hub ✅ Success (View Logs) Web Jul 31, 2026 at 4:13 am

Base automatically changed from stack/revert-rivetkit-core-drop-dangling-http-body-stream-re-exports-nwmvwykt to main July 31, 2026 04:14
@abcxff
abcxff force-pushed the stack/fix-rivetkit-treat-empty-actor-input-bytes-as-absent-ouvoqtns branch from 226de9f to e9dadf6 Compare July 31, 2026 05:27
@abcxff
abcxff force-pushed the stack/fix-rivetkit-treat-empty-actor-input-bytes-as-absent-ouvoqtns branch from e9dadf6 to 0283e79 Compare July 31, 2026 06:03
@claude

claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review

Small, well-scoped fix. Input::decode()/decode_or() now normalize a zero-length byte buffer to "absent" via a new present_bytes() helper, mirroring the existing decode_conn_params (bytes.is_empty() || bytes == [0xf6]) and Snapshot::decode patterns already in this file. Since a zero-length buffer is never valid CBOR on its own, this does not lose any real information: an empty payload could never have decoded successfully before this change, so treating it as "missing" instead of surfacing a CBOR decode error is a strict improvement. Good test coverage for both the unit-input and Default-input cases, plus a regression test confirming genuinely invalid (non-empty, malformed) CBOR still fails start.

One thing worth a look:

  • Input::is_present() (rivetkit-rust/packages/rivetkit/src/start.rs:44) still does self.bytes.is_some() and was not updated alongside present_bytes(). After this change, is_present() can return true for the same zero-length buffer that decode()/decode_or() now treat as absent. Input is a public type (pub mod start), so a caller doing if input.is_present() { input.decode() } could still hit MissingInput (or silently default via decode_or) despite is_present() reporting true. The two methods now disagree about what "present" means. Consider either routing is_present() through present_bytes() too, or adding a doc comment on is_present() clarifying that it does not filter empty buffers, so the asymmetry is intentional and discoverable rather than surprising.

Otherwise no correctness, performance, or security concerns. This is an internal, in-process CBOR decode path with no untrusted-boundary implications beyond what already existed.

@abcxff
abcxff force-pushed the stack/fix-rivetkit-treat-empty-actor-input-bytes-as-absent-ouvoqtns branch from 49b398a to 49f6c6b Compare August 10, 2026 22:09
@abcxff
abcxff changed the base branch from main to stack/fix-sdks-drop-rivet-util-metrics-dep-from-protocol-crates-to-unlink-rocksdb-woolkmvt August 10, 2026 22:09
@abcxff abcxff closed this Aug 11, 2026
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.

1 participant