Cache Components: propagate deduplicated nested cache metadata before cache-handler writes settle
Upstream: https://github.com/vercel/next.js/commit/d0df62e8265c07d4c1c40f0e39edd65e41a0545c
Summary
When an inner 'use cache' invocation is deduplicated by multiple outer cache scopes in one request, propagate its tags, lifetime, and root-parameter dependencies as soon as collection completes. Do not delay same-request propagation until an asynchronous cache-handler write finishes.
Cross-request joiners must still wait for the handler write before verifying a root-parameter-specific key and retrying the cache lookup.
Expected behavior
Two outer cached calls sharing an inner cached call inherit the inner metadata even while the inner cache-handler write is pending. A later request with different root params must not reuse the entry produced for another root-param value.
Upstream coverage
test/e2e/app-dir/app-root-params-getters/use-cache.test.tstest/e2e/app-dir/use-cache-custom-handler/use-cache-custom-handler.test.ts
Source: cloudflare/vinext