Skip to content

fix: settle WebSocket and IPC unsubscribe requests on failure - #5584

Merged
jxom merged 4 commits into
mainfrom
fix/socket-unsubscribe-settle
Nov 18, 2026
Merged

jxom merged 4 commits into
mainfrom
fix/socket-unsubscribe-settle

Conversation

@jxom

@jxom jxom commented Nov 18, 2026

Copy link
Copy Markdown
Member

Supersedes #5576 by @yinbowen-dc (their commits are kept).

  • WebSocket unsubscribe() uses requestAsync with the transport timeout, so it rejects on socket failures or missing responses instead of hanging and leaking a pending request (from fix: settle WebSocket unsubscribe requests on failure #5576).
  • The unsubscribe promise gets a no-op .catch, so watch* unwatch calls and the reconnect re-unsubscribe, which do not await it, no longer raise unhandled rejections. Awaiting callers still see the rejection.
  • IPC unsubscribe() gets the same fix.
  • Tests moved into webSocket.test.ts (describe('unsubscribe')) with an unwatch-over-a-closed-socket test, plus a matching IPC test in ipc.test.ts.
  • Changeset covers both transports.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
viem Error Error Nov 18, 2026 8:31pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 38fb217

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T20:28:34.946795Z 38fb217 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Published [email protected] under the pr-5584 dist-tag, which follows this pull request until it closes.

pnpm add viem@pr-5584
pnpm add [email protected]

@jxom
jxom merged commit c8b2a59 into main Nov 18, 2026
39 of 40 checks passed
@jxom
jxom deleted the fix/socket-unsubscribe-settle branch November 18, 2026 21:15
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026

This branch had an error being deployed

1 failed deployment
Preview — 38fb2171 Deployed Nov 18, 2026 by vercel[bot]
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