You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reviewed the diff (Cargo.toml, actor.rs, lib.rs, start.rs).
Summary of the change:
Registers rivetkit in [workspace.dependencies] so other in-repo crates can depend on it via workspace = true.
Re-exports rivetkit_core::serverless_http from the rivetkit crate.
Adds a Default bound to Actor::Input and switches run_actor to call input.decode_or_default() instead of input.decode(), so a missing input now falls back to Default::default() instead of erroring with MissingInput. The comment correctly explains this mirrors rivetkit-typescript, where createState just receives undefined.
Updates test fixtures (LifecycleInput, UnitInput) to derive Default and fixes several test-helper Start/Snapshot struct literals that were missing the is_new field (pre-existing from an earlier stacked change) so the crate compiles again.
Findings:
Test coverage gap for the actual behavior change. The new default-on-missing-input path is only exercised at the Input::decode_or_default() unit level (input_decode_or_default_uses_default_when_missing). There's no run_actor-level test (like run_actor_missing_unit_input_creates_state, but for a non-unit Default input) that proves create_state actually receives the defaulted value end-to-end when no input bytes are sent. The DefaultActor/DefaultInput fixtures added for the unit test don't implement create_state, so they can't currently be reused for that. Worth adding a run_actor-level integration test to lock in the new lifecycle behavior, since this is the actual production code path being changed.
Behavioral/breaking-change note (minor). Adding Default as a supertrait bound on Actor::Input changes the failure mode for any actor whose input is logically required: previously, a missing input would surface as an explicit ActorRuntime::MissingInput error; now it silently proceeds with Default::default() for any type where that's meaningful (not just unit-like types). This is presumably intentional (matches TS parity, and rivetkit (Rust) is called out as a preview API in CLAUDE.md), but it's a real semantic change for anyone relying on the old "missing input fails loudly" behavior, and it's also a breaking API change for downstream implementors whose Input type doesn't derive Default. Might be worth a one-line callout in the PR description / changelog.
Nit: unconditional re-export of a feature-gated module.rivetkit_core::serverless_http is behind #[cfg(feature = "native-runtime")] in rivetkit-core. The new pub use rivetkit_core::serverless_http; in rivetkit/src/lib.rs is unconditional. Today this is safe because rivetkit-core's default features (and thus rivetkit's dependency on it) include native-runtime, and rivetkit isn't part of the wasm build gate (scripts/cargo/check-rivetkit-core-wasm.sh only checks -p rivetkit-core). Just flagging so this doesn't bite later if rivetkit ever grows a wasm-targeted build.
No security or performance concerns — this is internal SDK/lifecycle wiring with no new trust-boundary-crossing code. Code style (comments, hard tabs, derive placement) matches CLAUDE.md conventions.
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
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.
No description provided.