From 76aa2dcb273e859f59f17d50f38a6f3584e80577 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:35:51 +0800 Subject: [PATCH] fix: notebook --- frontend/app/features/platform/state/editSessionSlice.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/app/features/platform/state/editSessionSlice.ts b/frontend/app/features/platform/state/editSessionSlice.ts index 7751d77..376c80d 100644 --- a/frontend/app/features/platform/state/editSessionSlice.ts +++ b/frontend/app/features/platform/state/editSessionSlice.ts @@ -50,10 +50,9 @@ export const createEditSessionSlice: StateCreator< if (getEditorOpening()) return; setEditorOpening(true); const api = requireApi(); - const requestId = getEditorOpenRequest() + 1; - // 记录本次请求的 id (供 requestIsCurrent 校验)。 - // 原版用模块级 _editorOpenRequest 配合闭包变量;现在 requestIsCurrent - // 通过 helpers 读取最新的模块级值 + getSelectedId()。 + // bump 模块级 _editorOpenRequest,捕获本次请求 id 用于 stale 检测 + // (如果后续 openScriptEditor / endEditing 又 bump 了,本请求就算过期)。 + const requestId = bumpEditorOpenRequest(); const requestIsCurrent = () => getEditorOpenRequest() === requestId && getSelectedId() === script.script_id;