Skip to content

fix(capture): close an open pause before a Linux take's stopped snapshot - #1645

Open
EtienneLescot wants to merge 1 commit into
mainfrom
fix/linux-stop-while-paused-cursor-1637
Open

EtienneLescot wants to merge 1 commit into
mainfrom
fix/linux-stop-while-paused-cursor-1637

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Refs #1637

Thanks @fernandezbaptiste for the clear report and the exact event sequence.

What changed

  • The Linux helper can emit capture-stopped while the take is paused, before the app calls stop(). That snapshot was compacted with the completed pause ranges only, so cursor samples from the open pause stayed in the take, past the video's end.
  • Both places that build the stopped snapshot (capture-stopped and the interrupted-take salvage) now go through one stoppedCursorData(), which closes the open pause first, at the helper's stop timestamp when it gives one.

Tests

  • New unit test with the issue's sequence: start 1000, sample 1100, pause 1200, sample 1300, capture-stopped 1500 (200 ms), stop() 1600 → samples [100]. It fails on main with [100, 300].
  • linuxNativeCaptureSession.test.ts 46/46, both typechecks, lint clean.

Scope
Pause and stop bookkeeping of cursor telemetry only. No change to frame capture, encoding, compositing or export timing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Cursor telemetry returned when a native capture stops now consistently excludes samples recorded during pauses, including when capture stops while paused or an interrupted capture is recovered.

The helper can emit capture-stopped while the take is paused, before
stop() runs. That snapshot was compacted with the completed pause ranges
only, so cursor samples from the open pause stayed in the take, past the
video's end. Both snapshot paths now close the open pause first, at the
helper's stop timestamp when it gives one.

Refs #1637
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Linux capture stop handling now closes an open cursor pause range before compacting stopped telemetry. Recovery and normal stop handling use the shared helper. A regression test checks that cursor samples from the paused interval are excluded.

Changes: Linux capture stop handling

Layer / File(s) Summary
Close pauses before compacting stopped telemetry
electron/native-bridge/capture/linuxNativeCaptureSession.ts, electron/native-bridge/capture/linuxNativeCaptureSession.test.ts
stoppedCursorData closes an open pause range at the supplied end time, or the current time, then compacts cursor telemetry. Recovery and normal capture-stopped handling use this helper; the latter passes the event timestamp. The regression test checks that the result contains only the pre-pause cursor sample.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • getopenscreen/openscreen#1637 — Reports cursor samples from an open paused interval remaining in the stopped snapshot. This change closes the pause range before compaction in both stopped snapshot paths.

Suggested reviewers: beetix, steffengy

Merge Risk: Minimal · up to 37bc3

This fixes Linux cursor telemetry when capture stops while a take is paused, so samples from the paused interval no longer extend past the video's end. The change is narrow, has a regression test, and shows no remaining merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a Linux take's stopped snapshot now closes an open pause first. It matches the summary, the stoppedCursorData() change, and the regression test. The title follows the …
Description check Passed The description covers the required template sections in substance. It has a Summary (What changed), a related issue (Refs #1637, a partial reference, which the template allows), Testing details, and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a Linux take's stopped snapshot now closes an open pause first. It matches the summary, the stoppedCursorData() change, and the regression test. The title follows the conventional commit format and is 72 characters long.

Full details: Description check

Explanation

The description covers the required template sections in substance. It has a Summary (What changed), a related issue (Refs #1637, a partial reference, which the template allows), Testing details, and Scope. It does not fill in the Type of change, Release impact, or Desktop impact checkboxes. Screenshots is not needed for this non-visual change. Those checkboxes are the missing parts.

Resolution

Optionally tick the Type of change (Bug fix), Release impact, and Desktop impact (Linux) checkboxes so the template is fully completed. The Related issue section uses Refs #1637, which is acceptable for a partial fix. Confirm that this is intended.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8747c51b-9f8b-436f-85df-56d5c94f1361
Commits

Reviewing files that changed from the base of the PR and between 00a0d96 and 37bc3f8.

Files selected for processing: 2

  • electron/native-bridge/capture/linuxNativeCaptureSession.test.ts
  • electron/native-bridge/capture/linuxNativeCaptureSession.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

This branch has not been deployed

No deployments
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.

1 participant