Skip to content

fix(screencast): deliver frames without CDP timestamp - #876

Merged
Kikobeats merged 1 commit into
masterfrom
fix/screencast-capture-frames
Aug 9, 2026
Merged

fix(screencast): deliver frames without CDP timestamp#876
Kikobeats merged 1 commit into
masterfrom
fix/screencast-capture-frames

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Release on master failed twice because @browserless/screencast capture frames asserted frames.length > 0 and got zero frames (unrelated to fix(function): resolve nodePaths under an isolated store #875).
  • CDP marks ScreencastFrameMetadata.timestamp as optional; the handler dropped those frames, so capture looked empty under GL/xvfb.
  • Fill a wall-clock timestamp fallback, harden the integration test with a local CSS-animated page, and add a unit test for omitted timestamps.

Test plan

  • pnpm --filter @browserless/screencast test (11 passed)
  • CI matrix + release recursive test green

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes

    • Screencast frames without timestamps are now delivered with a generated timestamp when frame handling is enabled.
    • Frames without a handler continue to be acknowledged and skipped correctly.
  • Tests

    • Improved frame-capture coverage, including validation for timestamp-less frames.
    • Updated animation testing for more reliable results.

CDP marks ScreencastFrameMetadata.timestamp optional; dropping those
frames left capture empty under GL/xvfb and blocked release.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 09a9c469-f338-4b56-9e00-430d1de7c398

📥 Commits

Reviewing files that changed from the base of the PR and between 6308f0d and e0a85b8.

📒 Files selected for processing (2)
  • packages/screencast/src/index.js
  • packages/screencast/test/index.js

📝 Walkthrough

Walkthrough

The screencast handler now delivers frames without timestamps by generating a wall-clock timestamp. Tests use local animation and verify frame delivery, metadata preservation, timestamp generation, and CDP acknowledgement.

Changes

Screencast frame normalization

Layer / File(s) Summary
Timestamp fallback handling
packages/screencast/src/index.js
onScreencastFrame defaults missing metadata and generates a timestamp when CDP omits one. Frames without a callback remain acknowledged and skipped.
Timestamp fallback coverage
packages/screencast/test/index.js
The capture test uses local animated content. Added coverage verifies delivery, metadata preservation, generated timestamps, and acknowledgement for frames without timestamps.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the fix for delivering screencast frames without a CDP timestamp.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/screencast-capture-frames

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.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 80.68% (+0.03%) from 80.653% — fix/screencast-capture-frames into master

@Kikobeats
Kikobeats merged commit 2e21df5 into master Aug 9, 2026
23 checks passed
@Kikobeats
Kikobeats deleted the fix/screencast-capture-frames branch August 9, 2026 11:33
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.

2 participants