Skip to content

chore(bidi): rewrite serialization error message#40490

Open
hbenl wants to merge 1 commit intomicrosoft:mainfrom
hbenl:rewrite-serialization-error
Open

chore(bidi): rewrite serialization error message#40490
hbenl wants to merge 1 commit intomicrosoft:mainfrom
hbenl:rewrite-serialization-error

Conversation

@hbenl
Copy link
Copy Markdown
Collaborator

@hbenl hbenl commented Apr 29, 2026

Fixes "should throw for too deep reference chain" in page/page-evaluate.spec.ts.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@hbenl hbenl force-pushed the rewrite-serialization-error branch from c625158 to a493c34 Compare April 29, 2026 16:53
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

12 failed
❌ [chrome] › mcp/network.spec.ts:90 › browser_network_requests numbers requests with stable indexes @mcp-windows-latest-chrome
❌ [firefox] › mcp/cli-devtools.spec.ts:217 › video-start-stop @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-devtools.spec.ts:231 › video-chapter @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:124 › daemon show: closing page exits the process @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:164 › should capture annotations via show --annotate @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:185 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:207 › should enter annotate mode on fresh dashboard.tsx mount with -s --annotate @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:231 › should switch screencast to -s session on show --annotate @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:280 › should disengage annotate mode when --annotate client disconnects @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:347 › save recording streams WebM bytes to the chosen file @mcp-windows-latest-firefox
❌ [msedge] › mcp/dashboard.spec.ts:347 › save recording streams WebM bytes to the chosen file @mcp-windows-latest-msedge
❌ [webkit] › mcp/dashboard.spec.ts:185 › should start dashboard and annotate when no dashboard is running @mcp-macos-latest-webkit

6809 passed, 927 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests 1"

3 flaky ⚠️ [chromium-library] › library/video.spec.ts:476 › screencast › should capture static page in persistent context @smoke `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [webkit-library] › library/video.spec.ts:275 › screencast › should capture navigation `@webkit-ubuntu-22.04-node20`

41476 passed, 847 skipped


Merge workflow run.

}

function rewriteError(error: Error): never {
if (error.message.includes('too much recursion') || error.message.includes('stack limit exceeded'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 'InternalError: too much recursion' is a message that is thrown for any stack overflow error, not just JSON serialization. We should discriminate those from from JSON.serialize() issue. Wouldn't it be more appropriate to check for something like "TypeError: cyclic object value"
?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'InternalError: too much recursion' is all we're getting from Firefox. Note that exceptions from the user's evaluated code won't end up here because if the evaluation throws then script.callFunction returns a response with response.type === 'exception' instead of rethrowing that exception.

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.

3 participants