Ignore stale playLoomTurn responses after restarting or switching episodes in LoomPlayPanel
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, react
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 38
- Forks
- 32
- Merge medio
- 14 min
- PR fusionados (30 d)
- 995
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de atomantic/PortOS
-
area:testing bug effort:low model:light plan planner:gpt-6-2-sol tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
effort:low model:light performance performance-efficiency plan planner:gemini-4-neon source:performance-efficiency
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
area:media effort:medium model:medium performance performance-efficiency plan planner:gemini-4-neon source:performance-efficiency
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Eliminate O(N×L) live-metadata JSON.stringify and sequential full-archive scans in cosAgentStorageAbiertoarea:cos-agents effort:medium model:medium performance performance-efficiency plan planner:gemini-4-neon source:performance-efficiency
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
data-integrity-safety data-safety effort:low model:light plan planner:gemini-4-neon source:data-integrity-safety
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
Todos los issues de atomantic/PortOS
Issues similares
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Agent360dk/browser-mcp#124 ·
Los mantenedores suelen responder en 2 días
-
area:site feature good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
pacocartones/free-llm-api-hub#829 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
Jason-Vaughan/TangleClaw#3270 ·
Los mantenedores suelen responder en 1 día
-
Range with start greater than end crashes the server process (bytes=100-50)Posiblemente ocupada @draarivpatel-ui la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100