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

Đang mở Phù hợp với người mới
#343 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/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ệ
node.js, typescript
Lĩnh vực
audio-video-rtc, backend

Hướng nghiên cứu

Đọc src/tools/pauseRecording.ts và src/tools/resumeRecording.ts cùng với src/utils/lifecycle.ts, nơi định nghĩa sessionOpInFlight và withSessionOp. Kiểm tra cách mỗi công cụ xử lý một thao tác đang diễn ra trước khi trả về trạng thái đã tạm dừng hoặc đang ghi âm. Thêm bài kiểm thử đơn vị được yêu cầu với thao tác tạm dừng chậm được giả lập và chạy npm test; hoàn tất khi cả hai trường hợp thao tác chồng lấn đều trả về lỗi yêu cầu thử lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
1
Fork
4
Merge trung bình
14 giờ 8 phút
Pull request đã merge (30 ngày)
48

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/screencast-mcp

Tất cả issue của TMHSDigital/screencast-mcp

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.