fix: 禁止预览命令触发自动快速存档#983
Conversation
拆分 stage commit 的 React 通知和自动快速存档副作用, 让预览同步命令显式关闭 autoFastSave。 同时将 commitOptions 沿脚本执行、perform 生命周期、 场景切换续接、选择枝和输入框回调传递,避免异步续接路径 回落到默认快速存档行为。 新增 StageStateManager commit 行为测试,覆盖显式关闭自动快存、 变量提交关闭自动快存,以及 notifyReact 与 autoFastSave 相互独立。
There was a problem hiding this comment.
Code Review
This pull request decouples the automatic fast-saving of the game from the React notification mechanism by introducing a new autoFastSave option to IStageCommitOptions. This option is propagated throughout the codebase, including the performance controller, script execution paths, and scene transition functions, and is explicitly disabled during preview and debug syncs. The feedback highlights a potential regression in stageStateManager.ts where silent commits (with notifyReact: false) might now unexpectedly trigger auto-saving because autoFastSave defaults to true. A code suggestion is provided to default autoFastSave to options.notifyReact to preserve backward compatibility.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
变更说明
修复编辑器预览命令触发 stage commit 时,会意外触发自动快速存档的问题。
本次改动将
notifyReact和autoFastSave拆成两个独立的 commit 副作用:普通游戏流程默认继续自动快速存档,编辑器预览流程显式传入
{ autoFastSave: false }。主要改动
StageStateManager.commit()增加autoFastSave选项。notifyReact改为autoFastSave。commitOptions沿以下链路传递:nextSentence -> forward -> scriptExecutor -> runScript-continue自动推进changeScene/callScene/restoreScene的异步续接choose和getUserInput的用户回调