Ignore stale playLoomTurn responses after restarting or switching episodes in LoomPlayPanel
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start in client/src/components/fableloom/LoomPlayPanel.jsx, where runTurn awaits playLoomTurn and then sets scene, playbackPhase and transcript, and where restart() is wired to the useEffect keyed on start. Read how restart() resets state, then add a generation ref that restart() bumps and that runTurn checks after the await. Done when a late playLoomTurn response after Restart or an episode switch leaves scene and transcript untouched, proven by a new test in LoomPlayPanel.test.jsx.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Slice audited: FableLoom (client/src/pages/FableLoom*.jsx, client/src/components/fableloom, server/routes/fableLoom.js, server/services/fableLoom, server/sockets/fableLoomHosted.js)
Date: 2026-11-26
Scope: small
Problem
In client/src/components/fableloom/LoomPlayPanel.jsx:281-289, 296, 306-334, runTurn awaits playLoomTurn(...) and unconditionally calls setScene(result.node), setPlaybackPhase(...), and setTranscript((prev) => [...prev, ...additions]) without checking whether the session was restarted or switched to another episode while the request was in flight.
This race is directly reachable:
- On an automatic-cut scene, the Restart button (
LoomPlayPanel.jsx:697-703) remains enabled whilesendingistrue, so clicking Restart during an in-flightplayLoomTurnresets the panel to the opening scene and then the late response jumpssceneback to the pre-restart destination and appends stale transcript entries. - Switching episodes (
initialEpisode.idchanging while a slow free-text LLM turn is in flight) triggersrestart()viauseEffect(..., [start])(LoomPlayPanel.jsx:296), and the stale turn response from the previous episode overwrites the new episode's opening scene and transcript.
Impact
Late playLoomTurn responses corrupt the restarted or newly opened episode's scene state and transcript in LoomPlayPanel.
Fix
In client/src/components/fableloom/LoomPlayPanel.jsx:
- Add a
sessionGenerationRef = useRef(0)that increments inrestart(). - Capture
const generation = sessionGenerationRef.currentbeforeawait playLoomTurn(...)inrunTurn, and return early without mutatingscene,playbackPhase,activeHoldIndex,pendingTransition, ortranscriptifsessionGenerationRef.current !== generation. - Add a regression test in
client/src/components/fableloom/LoomPlayPanel.test.jsxverifying that aplayLoomTurnresolving after clicking Restart (or switching episodes) does not overwrite the reset scene or append to the reset transcript.
Acceptance criteria
- Clicking Restart while a
playLoomTurnrequest is in flight ignores the stale response when it resolves. - Switching episodes while a
playLoomTurnrequest is in flight ignores the stale response from the previous episode. - Regression test in
client/src/components/fableloom/LoomPlayPanel.test.jsxcovers this race and passes.
- Ngôn ngữ chính
- JavaScript
- Star
- 38
- Fork
- 32
- Merge trung bình
- 14 phút
- Pull request đã merge (30 ngày)
- 995
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của atomantic/PortOS
-
area:testing bug effort:low model:light plan planner:gpt-6-2-sol tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:low model:light performance performance-efficiency plan planner:gemini-4-neon source:performance-efficiency
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:media effort:medium model:medium performance performance-efficiency plan planner:gemini-4-neon source:performance-efficiency
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Eliminate O(N×L) live-metadata JSON.stringify and sequential full-archive scans in cosAgentStorageĐang mởarea:cos-agents effort:medium model:medium performance performance-efficiency plan planner:gemini-4-neon source:performance-efficiency
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
data-integrity-safety data-safety effort:low model:light plan planner:gemini-4-neon source:data-integrity-safety
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của atomantic/PortOS
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
directus/directus#28558 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
cloudflare/workers-sdk#17189 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
AWS Lambda Waiting for: Product Owner
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
getsentry/sentry-javascript#26910 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[🐛 Bug]: @wdio/reporter drops the function name of a string script in command outputCó thể đã có người làm @dhananjay6561 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
webdriverio/webdriverio#16507 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày