Skip to content

Commit 4ad2b0a

Browse files
anthony-murphy-agentclaudeanthony-murphy
committed
Fix exitStagingMode for rehydrated containers
When a container is rehydrated from pending state while in staging mode, the DataObject doesn't have stageControls (only set when enterStagingMode is called). Handle this gracefully by returning early instead of asserting. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Co-Authored-By: anthony-murphy <anthony.murphy@microsoft.com>
1 parent 2e83ddd commit 4ad2b0a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/test/local-server-stress-tests/src/stressDataObject.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,12 @@ export class DefaultStressDataObject extends StressDataObject {
314314
}
315315

316316
public exitStagingMode(commit: boolean): void {
317-
assert(this.stageControls !== undefined, "must have staging mode controls");
317+
// If stageControls is undefined but we're in staging mode, this means
318+
// the container was rehydrated from pending state while in staging mode.
319+
// We can't exit staging mode from here - skip gracefully.
320+
if (this.stageControls === undefined) {
321+
return;
322+
}
318323
if (commit) {
319324
this.stageControls.commitChanges();
320325
} else {

0 commit comments

Comments
 (0)