Skip to content

fix(recording): keep cursor telemetry for the screen recording when a webcam companion is stored - #1039

Open
hawks-vision wants to merge 1 commit into
webadderallorg:mainfrom
InverseZeroSecurity:fix/webcam-companion-cursor-telemetry
Open

hawks-vision wants to merge 1 commit into
webadderallorg:mainfrom
InverseZeroSecurity:fix/webcam-companion-cursor-telemetry

Conversation

@hawks-vision

@hawks-vision hawks-vision commented Sep 25, 2026 •

Copy link
Copy Markdown

Description

Keep the session's cursor telemetry for the screen recording when a webcam companion file is stored.

  • electron/ipc/recording/storagePath.ts: add isWebcamCompanionRecordingPath(), which matches recording-<digits>-webcam.(webm|mp4), the same naming resolveRecordedVideoStoragePath already accepts.
  • store-recorded-video (electron/ipc/register/recording.ts): for webcam companions, write and validate the file, then return { success, path } without running the screen-recording finalization (cursor telemetry persist, current video/project state, auto-recording prune).
  • Unit tests for the new helper.

Motivation

With the webcam enabled, the renderer stores the webcam companion (recording-<ts>-webcam.*) before the screen recording. Both went through finalizeStoredVideo(), which persists the pending cursor telemetry next to the file and then clears it. The webcam file got the telemetry (…-webcam.mp4.cursor.json), and the screen recording got none, so auto-zoom suggestions and cursor effects were empty in the editor.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Fixes #1038

Screenshots / Video

Before: only recording-<ts>-webcam.mp4.cursor.json is written, and getCursorTelemetry(<screen .webm>) returns 0 samples.
After: recording-<ts>.webm.cursor.json is written, and the editor loads its samples (108 in a 10 s test).

Testing Guide

  1. Enable the webcam overlay (and optionally the mic) in the HUD.
  2. Record ~10 s while moving the mouse, then stop.
  3. In the recordings folder, recording-<ts>.webm.cursor.json should exist, and the editor should offer cursor effects / "Suggest Zooms from Cursor" for the recording.

Automated:

  • npx vitest --run electron/ipc/recording/storagePath.test.ts: 31 passed (6 new)
  • npx tsc --noEmit: clean
  • npx biome check on the changed files: clean (the import-order notice at the top of register/recording.ts is pre-existing on main)

Manually verified on Kali Linux (XFCE, X11) with an equivalent change applied to the 1.4.0 build.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Investigated with AI assistance (Claude); tested on Kali Linux.

Summary by CodeRabbit

  • Bug Fixes
    • Webcam companion recordings in .webm and .mp4 formats are now recognized during saving, while ordinary recordings continue through the existing process.
    • Webcam companion files without a timestamp or in .mov format are not treated as supported companion recordings.

… webcam companion is stored

The webcam companion is stored before the screen recording, and both went
through finalizeStoredVideo(), which persists and then clears the pending
cursor telemetry. The webcam file got the telemetry and the screen recording
got none, so auto-zoom and cursor effects were empty in the editor.

Webcam companions are now only written and validated.

Fixes webadderallorg#1038

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: webadderallorg/Recordly/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: cbe023f7-8ddc-44a7-95c7-345f704ed60a

📥 Commits

Reviewing files that changed from the base of the PR and between 1888428 and 113c3c7.

📒 Files selected for processing (3)
  • electron/ipc/recording/storagePath.test.ts
  • electron/ipc/recording/storagePath.ts
  • electron/ipc/register/recording.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The recording storage handler now detects webcam companion paths and returns those videos after validation without finalizing them. Other recordings continue through the existing finalization flow.

Changes

Webcam Companion Recording Storage

Layer / File(s) Summary
Webcam companion path detection
electron/ipc/recording/storagePath.ts, electron/ipc/recording/storagePath.test.ts
Adds and tests a helper that recognizes timestamped webcam companion paths with .webm or .mp4 extensions.
Webcam companion storage branch
electron/ipc/register/recording.ts
The handler validates webcam companion videos and returns their paths without finalizing them. Other videos continue through the existing finalization flow.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: meiiie

Merge Risk: ⚪ Minimal · up to 113c3

Webcam companions are validated without consuming pending cursor samples, while screen recordings retain cursor-sidecar creation. No concrete merge-blocking risk is evident.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 113c3

Filename restrictions and video validation remain in place. A failed screen save can, however, leave a locally stored webcam capture unlinked to a visible recording. The reviewed change does not show a broader access or deployment change.

Retained concerns

  • Low · security · inferred: A successfully stored webcam companion can remain on disk without becoming the current recording or a recovery candidate if the subsequent screen save fails. Unlike the prior webcam finalization path, the new branch does not set the current video path; no cleanup transition is shown for this failure sequence.
Security review details

Security Blast Radius

  • inferred — The identified failure exposure is a webcam capture left in the configured local recordings directory. The reviewed path does not establish cross-service or cross-tenant reachability.

Security Findings and Attack Paths

  • inferred — If webcam storage succeeds and screen storage fails, the companion is not made current by the new branch, and the recovery lookup does not select webcam filenames. This can leave sensitive capture data less discoverable for removal; no remote attack path is established.

Trust Boundaries and Controls

  • observed — The renderer supplies the filename and video bytes to the recording IPC handler. The resolver restricts the filename and storage path, and video validation remains required for a successful webcam response.

Resilience and Maintainability Implications

  • observed — A webcam validation error returns failure after the file write, without removing that file in this handler. The write-then-validate behavior also existed on the prior finalization path, so it is not independently attributed to this PR.

Hardening Proposals

  • proposed — Give companion files an explicit cleanup or recovery owner when screen storage fails or is interrupted, while preserving the rule that only the screen recording consumes cursor telemetry.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the bug fix and its primary outcome: preserving cursor telemetry for the screen recording when a webcam companion is stored.
Description check ✅ Passed The description is complete and relevant. It explains the change and motivation, identifies the bug-fix type, references issue #1038, provides testing steps and results, and includes the checklist. Th…
Linked Issues check ✅ Passed Issue #1038 requires cursor telemetry to remain available for the screen recording and requires the webcam companion to skip screen-recording finalization. The PR detects `recording--webcam.(w…
Out of Scope Changes check ✅ Passed The changes are limited to webcam companion path detection, the store-recorded-video handling required by issue #1038, and unit tests for the new path detector. These changes directly support the li…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor telemetry is saved next to the webcam file, so the screen recording has none (auto-zoom/cursor effects missing when webcam is on)

1 participant