mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #498] [MERGED] fix: dedup stale background refetches in fetch cache #620
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#620
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/498
Author: @NathanDrake2406
Created: 3/12/2026
Status: ✅ Merged
Merged: 3/12/2026
Merged by: @james-elicx
Base:
main← Head:fix/fetch-cache-stale-dedup📝 Commits (7)
d4be71dfix: dedup stale background refetches in fetch cachef6d0063test: add fetch cache stale dedup concurrency testse57c05eUpdate packages/vinext/src/shims/fetch-cache.ts2faabaafix: repair broken setTimeout structure from review suggestion8c7baaffix: wrap fake timer tests in try/finally for safety5caf79efix: guard background revalidation against caching error responsesb4840c0fix: tighten cache guard to status === 200📊 Changes
2 files changed (+423 additions, -39 deletions)
View changed files
📝
packages/vinext/src/shims/fetch-cache.ts(+94 -37)📝
tests/fetch-cache.test.ts(+329 -2)📄 Description
Summary
originalFetch(), creating a thundering herd on popular endpointspendingRefetches) shared across RSC/SSR environments viaSymbol.for(), matching the existing ISR regeneration dedup pattern inisr-cache.ts.finally()andsetTimeoutto prevent slot-ownership racesTest plan
vi.useFakeTimers)_resetPendingRefetches()called inbeforeEachfor test isolation🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.