mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #1002] fix: pumpReader silently swallows stream errors — getRawBuffer() returns incomplete ISR cache data #218
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#218
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Divkix on GitHub (May 1, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/1002
James flagged this on #984 (review comment):
Location:
packages/vinext/src/server/app-ssr-stream.ts:51-54What happens:
pumpReader()catches stream read errors but never re-throws.pumpPromisealways resolves. Bothfinalize()andgetRawBuffer()awaitpumpPromiseand proceed as if all data is present. If the stream errored mid-read,getRawBuffer()returns a truncatedArrayBufferwith chunks read before the failure — and the ISR cache (src/server/app-page-cache.ts:357) writes this corrupt data silently.Fix: Re-throw the error after the dev warning so
pumpPromiserejects —finalize()andgetRawBuffer()will then properly fail, and the existing catch inscheduleAppPageRscCacheWrite(line 376) already handles the error path for ISR.