fix(rivetkit-core): keep sleeping actors reachable during grace#4939
fix(rivetkit-core): keep sleeping actors reachable during grace#4939NathanFlurry merged 1 commit intomainfrom
Conversation
PR #4939 Review: fix(rivetkit-core): keep sleeping actors reachable during graceOverviewThis PR fixes a bug where actors entering the sleep grace period ( Code Qualitytask.rs — The diff introduces a stray closing brace at 3-tab indent inside the if matches!(lifecycle, LifecycleState::Started) {
self.ctx.reset_abort_signal_for_start();
self.ctx.clear_sleep_requested();
} // closes if (stray brace, misindented at 3 tabs)
self.ctx.set_started(matches!(...)); // looks like it's inside the if, but isn't
} // closes transition_toThe code is semantically correct (braces balance, The semantic intent is correct: registry/mod.rs — indentation inconsistencies Several blocks shifted indent by one extra level (e.g. CorrectnessCore logic — correct The ActorInstanceState::Stopping { instance, reason } => {
match reason {
ShutdownKind::Sleep if instance.ctx.started() => return Ok(instance),
// ...
}
}Because Active branch — The previous code rejected The comment at Exhaustive match on The new Potential Concerns
TestsUn-skipping 4 tests from issue #4705 is correct — this is the proper fix, not a retry workaround. No new test cases for the specific new reachability behavior, but the existing suite covering dispatch and WebSocket behavior during sleep shutdown provides sufficient coverage. SummaryThe fix is logically sound. Two pre-merge asks:
|
Preview packages published to npmInstall with: npm install rivetkit@pr-4939All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-2da0d18
docker pull rivetdev/engine:full-2da0d18Individual packagesnpm install rivetkit@pr-4939
npm install @rivetkit/react@pr-4939
npm install @rivetkit/rivetkit-napi@pr-4939
npm install @rivetkit/workflow-engine@pr-4939 |
6512e52 to
a877360
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: