Disarming a triggered recording while it starts says "nothing was recorded", but the recording starts

Đang mở
#342 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/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
backend, testing

Hướng nghiên cứu

Read src/utils/triggers.ts around disarm and armStart, then inspect the disarm branch in src/tools/stopRecording.ts and the trigger tests in src/__tests__/triggers.test.ts. Run npm test to see the existing behavior. Add a delayed fake fire test; done means stopping during startup leaves no live session and the response accurately reports that the session was stopped.

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

Mô tả

bug effort: small priority: medium

Summary

When startWhen fires, armStart runs the whole start (await o.fire()) while the arm's status is still "armed". A stop_recording on the arm id during that window takes the disarm branch and reports cancelled / "Disarmed; nothing was recorded.", but the start then finishes and a recording runs until its cap.

Where

  • src/utils/triggers.ts:59-65 (disarm only checks status !== "armed")
  • src/utils/triggers.ts:147-151 (fire() awaited without changing status, then status = "started")
  • src/tools/stopRecording.ts:86-90 (disarm branch)
  • src/tools/startRecording.ts:489 (the fired start runs the full handler: target resolution, event logger, encoder probe, settle)

Impact

The agent and the user are told the armed capture was cancelled and nothing was recorded, while the screen (and the input-event log if requested) is recorded a moment later for up to the cap (default 1 h). Nothing in the response shows that a session exists.

Steps to reproduce

  1. start_recording {"target":"full","startWhen":{"window":"window:Notepad"},"events":true}
  2. Open Notepad, and within 1-3 s (while the start runs) call stop_recording {"sessionId":"arm-..."}. The response is status: "cancelled".
  3. A few seconds later, list_sessions shows a new recording session.

Suggested fix

Set a distinct status (e.g. "starting") before await o.fire(). In stop_recording, for a "starting" arm, record a cancel request that armStart honours by stopping the session as soon as fire returns (or await the fire's promise and then stop the session). Report "nothing was recorded" only for an arm that was still waiting.

Acceptance criteria

  • Stopping an arm whose start is in progress stops the session it produces, and the response says so.
  • Test with a fake fire that resolves after a delay: stop during the delay leaves no live session.

Getting started

  • Relevant files: src/utils/triggers.ts, src/tools/stopRecording.ts, src/__tests__/triggers.test.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at b9b94fa. Severity: medium. Effort: S. audit-key: bug|src/utils/triggers.ts|armStart

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.