Skip to content

fix: isolate HTTP batches between transports - #5389

Merged
jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/http-batch-transport-isolation
Nov 3, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/http-batch-transport-isolation

Conversation

@mortezashojaei

Copy link
Copy Markdown
Contributor

Summary

Concurrent batch-enabled HTTP transports at the same URL can send both clients' requests using the first transport's authorization headers and fetch configuration.

Give each http() factory a stable batch identity, while retaining URL and signal separation:

- batch key = URL + signal
+ batch key = HTTP factory identity + URL + signal

The identity stays outside the transport initializer so fallback can initialize a transport per request without disabling batching. Added real-server regressions and a docs note explaining how to share batches across clients.

Evidence

  • Before: both direct HTTP and fallback return chain IDs [1, 1] instead of [1, 10] for clients with different authorization headers.
  • After: 116 tests passed across the HTTP, fallback, transport, batch scheduler, and HTTP RPC client suites; one existing test skipped. Shared-factory batching, resolved default URLs, and signal separation are covered.
  • pnpm check:types and full-repository pnpm exec biome check passed.
pnpm test --run --project core \
  src/clients/transports/{http,fallback,createTransport}.test.ts \
  src/utils/promise/createBatchScheduler.test.ts \
  src/utils/rpc/http.test.ts --retry=0

Merge Danger

Door: two-way

Blast Radius: batching

Independently created HTTP factories no longer combine batches, even with identical configuration. Reusing a factory preserves batching across clients and through fallback. No public API changes.

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

@mortezashojaei 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 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fd30a40

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
jxom merged commit 5a7ec09 into wevm:main Nov 3, 2026
29 of 36 checks passed
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