mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #515] [MERGED] fix: propagate middleware waitUntil to Workers execution context #636
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#636
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?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/515
Author: @NathanDrake2406
Created: 3/13/2026
Status: ✅ Merged
Merged: 3/13/2026
Merged by: @james-elicx
Base:
main← Head:fix/app-router-mw-waituntil📝 Commits (1)
7d83101fix: propagate middleware waitUntil promises to Workers execution context📊 Changes
3 files changed (+24 additions, -2 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+3 -1)📝
tests/__snapshots__/entry-templates.test.ts.snap(+3 -1)📝
tests/app-router.test.ts(+18 -0)📄 Description
Summary
mwFetchEvent.drainWaitUntil()but discarded the return value, so middleware background promises registered viaevent.waitUntil()were abandoned when the response was sent on Cloudflare Workers_getRequestExecutionContext()?.waitUntil(), matching the pattern the Pages Router entry already uses (pages-server-entry.ts:208)Test plan
app-router.test.tsverifying the generated code registersdrainWaitUntil()with the execution contextentry-templates.test.tssnapshot🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.