pause/resume report "Already paused/recording" while the other operation is still running

Abierto Apto para principiantes
#343 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript

Línea de trabajo

Lee src/tools/pauseRecording.ts y src/tools/resumeRecording.ts junto con src/utils/lifecycle.ts, donde se definen sessionOpInFlight y withSessionOp. Comprueba cómo gestiona cada herramienta una operación en curso antes de devolver el estado de «ya está pausado» o «ya está grabando». Añade la prueba unitaria solicitada con una pausa lenta simulada y ejecuta npm test; el trabajo estará terminado cuando ambos casos de operaciones solapadas devuelvan un error para reintentar.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug effort: small good first issue priority: medium

Summary

resume_recording and pause_recording return early based on the persisted status, before the per-session operation lock. runPause keeps the record at status: "recording" until the segment has quit and been probed (up to the 8 s graceful wait plus ffprobe), so a resume in that window returns "Already recording." and the session then ends up paused. The mirror case applies to pause during a resume.

Where

  • src/tools/resumeRecording.ts:28-34, src/tools/pauseRecording.ts:28-34 (status short-circuit)
  • src/utils/lifecycle.ts:141-147 (withSessionOp is meant to reject a colliding operation)
  • src/utils/lifecycle.ts:237-238 (status written only after the pause finishes)
  • sessionOpInFlight exists for this check but no tool calls it

Impact

An agent that pauses and then quickly resumes (or a client that retries or parallelizes calls) is told the recording is running when it is paused, so the rest of the task is not captured. In the mirror case it is told capture is paused while it is still recording the screen.

Steps to reproduce

  1. start_recording {"target":"full"}
  2. Call pause_recording, and before it returns call resume_recording with the same id. Resume returns {status:"recording", note:"Already recording."}.
  3. After pause returns, get_session shows status: "paused".

Suggested fix

In both tools, check sessionOpInFlight(store, id) before the status short-circuit and throw the same "a of it is in progress; retry" error that withSessionOp uses. Report "Already paused/recording" only when no operation is in flight.

Acceptance criteria

  • resume during an in-flight pause (and pause during an in-flight resume) returns an error asking to retry.
  • Unit test with a stubbed slow pause.

Getting started

  • Relevant files: src/tools/pauseRecording.ts, src/tools/resumeRecording.ts, src/utils/lifecycle.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at b9b94fa. Severity: medium. Effort: S. audit-key: bug|src/tools/resumeRecording.ts|register

Lenguaje dominante
TypeScript
Estrellas
1
Forks
4
Merge medio
14 h 8 min
PR fusionados (30 d)
48

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/screencast-mcp

Todos los issues de TMHSDigital/screencast-mcp

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.