fix(rivetkit): defer initialized persist until state exists#4974
fix(rivetkit): defer initialized persist until state exists#4974NathanFlurry merged 1 commit intomainfrom
Conversation
Code ReviewOverviewThis PR fixes a race condition where Issues
The test callback's event loop uses a wildcard arm: _ => {}Per CLAUDE.md conventions, Redundant const PERSIST_DATA_KEY: &[u8] = &[1];This replaces an import that was removed. If the real key ever changes, this local copy will silently diverge and tests will pass against a stale key. Either keep the import from SuggestionsMissing comment on the deferred-init condition ( if !is_new || !self.factory.requires_manual_startup_ready() {The invariant — that initialization must not be persisted until the runtime's Consider documenting the fallback path after if !self.ctx.persisted_actor().has_initialized {
self.ctx.set_has_initialized(true);
}The guard exists to avoid double-setting when the runtime callback already called
The logic of treating empty bytes as Positives
|
de6ffdd to
b8cd998
Compare
e987ebe to
342f41d
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: