mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #429] [MERGED] fix(isr): use getRequestExecutionContext() from ALS in background regeneration #566
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#566
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/429
Author: @james-elicx
Created: 3/10/2026
Status: ✅ Merged
Merged: 3/10/2026
Merged by: @james-elicx
Base:
main← Head:opencode/brave-wizard📝 Commits (1)
433e1fdfix(isr): use getRequestExecutionContext() from ALS in background regeneration📊 Changes
3 files changed (+31 additions, -22 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+4 -3)📝
packages/vinext/src/server/isr-cache.ts(+3 -1)📝
tests/__snapshots__/entry-templates.test.ts.snap(+24 -18)📄 Description
Summary
__triggerBackgroundRegenerationinapp-rsc-entry.tswas receivingctxas a parameter from the outer request handler, but by the time the stale-while-revalidate branch executed, that reference could be stale or absent — causingwaitUntil()to never be called and the Workers isolate to terminate before the revalidation completedgetRequestExecutionContext()(AsyncLocalStorage-backed) inside the function to always retrieve the liveExecutionContextfor the current requestisr-cache.ts'striggerBackgroundRegenerationso the dev-server path (which passes noctx) also benefits🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.