Skip to content

fix(screencast): throw if start() is called without onFrame handler#763

Merged
Kikobeats merged 1 commit into
masterfrom
fix/screencast-require-onframe
May 17, 2026
Merged

fix(screencast): throw if start() is called without onFrame handler#763
Kikobeats merged 1 commit into
masterfrom
fix/screencast-require-onframe

Conversation

@Kikobeats
Copy link
Copy Markdown
Member

@Kikobeats Kikobeats commented May 17, 2026

Summary

  • Throw a clear error when start() is called before registering an onFrame callback, instead of silently dropping frames
  • Update tests to register onFrame before start() where missing

Context

If start() was called before onFrame(), CDP frames were acknowledged but never delivered to the caller, with no error or warning. This makes the API fail fast with an actionable message.

Closes #698

Made with Cursor


Note

Low Risk
Low risk: adds a fail-fast runtime check and adjusts tests; behavior only changes for incorrect caller usage (calling start() without registering onFrame).

Overview
packages/screencast now throws a clear error if start() is called before an onFrame callback is registered, instead of starting the CDP screencast and silently dropping frames.

Tests are updated to always register a no-op onFrame handler before starting screencast sessions, keeping the listener cleanup assertions intact.

Reviewed by Cursor Bugbot for commit ed06bb5. Bugbot is set up for automated code reviews on this repo. Configure here.

Fail fast with a clear error instead of silently dropping frames
when no callback is registered before starting the screencast.

Closes #698

Co-authored-by: Cursor <cursoragent@cursor.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 74.717% (-0.02%) from 74.733% — fix/screencast-require-onframe into master

@Kikobeats Kikobeats merged commit a3689b1 into master May 17, 2026
20 of 22 checks passed
@Kikobeats Kikobeats deleted the fix/screencast-require-onframe branch May 17, 2026 21:37
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.

[Detail Bug] Screencast recordings silently lose frames when onFrame is registered after start

2 participants