Skip to content

fix: ensure close handler is attached for Blob/ReadableStream cacheable responses#342

Open
usualoma wants to merge 1 commit intov2from
perf-v2-close-handler-4
Open

fix: ensure close handler is attached for Blob/ReadableStream cacheable responses#342
usualoma wants to merge 1 commit intov2from
perf-v2-close-handler-4

Conversation

@usualoma
Copy link
Copy Markdown
Member

The previous fast-path check (introduced in #333) (cacheKey in res) did not distinguish body types, allowing Blob and ReadableStream responses to skip close handler registration. This meant client disconnects during async body processing would not trigger AbortSignal.

Restrict the fast path to body types that complete synchronously (null, string, Uint8Array) via isImmediateCacheableResponse. All other cacheable responses now go through ensureCloseHandler for proper abort detection.

@usualoma
Copy link
Copy Markdown
Member Author

Hi @yusukebe
Would you mind reviewing this?

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.

1 participant