Skip to content

fix: route invalid IPC JSON to request errors - #5574

Closed
yinbowen-dc wants to merge 1 commit into
wevm:mainfrom
yinbowen-dc:codex/fix-5562-ipc-invalid-json
Closed

yinbowen-dc wants to merge 1 commit into
wevm:mainfrom
yinbowen-dc:codex/fix-5562-ipc-invalid-json

Conversation

@yinbowen-dc

Copy link
Copy Markdown
Contributor

Fixes #5562.

Catch malformed IPC JSON inside the socket data listener and forward the error to the existing socket error path, matching WebSocket handling. Pending requests receive SyntaxError and release their callbacks.

Validation: the real IPC regression on main produces an uncaught SyntaxError and eventually TimeoutError; with the patch it rejects with SyntaxError. All 22 related parsing, framing and request-timeout tests pass. Biome passed. Includes a patch changeset. Full project types currently require generated test-contract artifacts.

AI assistance: implementation and tests prepared with Codex at the account owner's request.

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

@yinbowen-dc is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a264373

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

jxom commented Nov 18, 2026

Copy link
Copy Markdown
Member

Thanks @yinbowen-dc for finding and fixing this! I've continued it in #5586, which keeps your commit and narrows the catch to JSON.parse so errors from user callbacks don't reject other requests.

@jxom jxom closed this Nov 18, 2026
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.

ipc transport: a frame that is not valid JSON throws an uncaught exception

2 participants