You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7ef0e37
Browse filesBrowse the repository at this point in the historyBrowse files
* fix(ppr): guard the shell-HIT redirect degradation against open redirects
The shell-HIT tail's degradation branch emitted <script>location.replace(raw
match.redirect)</script> into an already-committed 200 body, bypassing the 3xx
guardOutgoingRedirect chokepoint. Route the target through the shared
resolveSameOriginRedirect (extracted as resolveShellHitRedirectTarget) so a
cross-origin/unsafe target neutralizes to the basename root, matching every
other redirect exit.
* docs(caching): document render-callable cacheTag() in skills and design docs
cacheTag() shipped a second, render-callable form (#648): called during a
request render outside a "use cache" function it records onto the document/
shell artifact. Four skills and two canonical design docs still taught it as
"use cache"-only; the ppr-shell-resume out-of-scope bullet contradicted the
shipped auto-collection. Correct all six, plus notes on the no-TTL marker cost
and that action invalidation does not evict the server shell.
* fix(cache): host-namespace the default document-cache key
VercelCacheStore and MemorySegmentCacheStore key the response cache by the raw
string with no host prefix (only CFCacheStore adds host internally), so on one
function serving multiple domains the default document-cache key bled tenant
A's full response to tenant B. Prefix url.host on the default-key branch,
mirroring cache-scope.getCacheKeyBase; the keyGenerator branch is left to the
consumer with a JSDoc warning.
* fix(cache): bound Vercel store base64 chunk via the shared cf-base64 helpers
The Vercel store spread up to 32768 bytes into String.fromCharCode, 4x closer
to the JS argument-count ceiling than the CF encoder's deliberate 8192-.apply;
a large body could throw RangeError inside putResponse/putShell and degrade
silently to no-cache. Delegate both encode and decode to the import-pure
cf-base64.ts (byte-identical output, no cache cold-start).
* feat(cache): warn once per namespace on CF tag invalidation with no marker expiry
With tagInvalidationTtl unset (the default) every invalidated tag writes a
permanent KV marker; high-cardinality tags accumulate KV keys unboundedly with
no reaper. Emit a one-time-per-namespace warning at the invalidateTags batch
entry point pointing at the sizing rule, mirroring the existing floor-warning
idiom. No default-behavior change.
* test(e2e): add production-mode coverage for navigation loading states
navigation-loading.test.ts ran both describes dev-only, and check:e2e-parity is
warn-only so the gap never failed CI. Extract each body into a spec function and
add a (production) mode:"build" sibling, mirroring shell-cache.test.ts. The 10
production tests pass locally.
* feat(ppr): diagnostics for untagged shell bake and the silent action-refetch drop
Two silent PPR/action edges now emit signal without changing behavior. (A) When
a bake-lane loader freezes data into the shell but the capture recorded zero
tags, that data is un-invalidatable except by TTL (an action refresh touches the
client only); warn once per shell key in dev. (B) The action-mode missing-
segments branch in partial-update was a bare return with no diagnostic; log the
intentional drop.
* fix(ppr): SSR capture stops masking real errors, bounds bootstrap, closes reader leak
captureShellHTML swallowed any AbortError-named throw into a null no-shell
degrade because it aborts before awaiting, so signal.aborted was always true;
discriminate the deliberate abort by identity (error === abortReason), verified
against real react-dom/static.edge. Also arm the maxWaitMs deadline before the
bootstrap load so a hung load degrades bounded, and add try/finally reader
cleanup on the mid-read error path.
| `updateTag` / `revalidateTag` on a SHELL tag | YES — drops the shell → MISS → recapture | n/a (holes are already live) |
527
528
| `updateTag` / `revalidateTag` on a LOADER tag | no — loader tags never attach to a shell | drops that loader's cached value (if it `cache()`s) |
528
529
| `revalidate()` (namedrevalidationcontract) | **no** — re-runs segments/loaders for the PAYLOAD, never HTML | yes — the hole re-renders with fresh data |
529
530
531
+
A server action's automatic invalidation refreshes the CLIENT only — it re-runs
532
+
the holes and streams a fresh payload, but does NOT evict the server shell.
533
+
Shell-baked data stays stale until the shell's TTL unless you tag-invalidate it
534
+
(`updateTag` on a shell tag). Data baked into the shell WITHOUT a tag cannot be
535
+
evicted by tag at all — move always-fresh data under a `loading()` hole.
536
+
530
537
## Pitfalls
531
538
532
539
- **A bake-lane loader that reads `cookies()`/`headers()`**: thecaptureis
@@ -574,8 +581,11 @@ cache"` value baked into the shell is PINNED at capture (the capture data
574
581
tag-invalidated. This is deliberate — parity beats freshness inside the shell.
575
582
If a shell region needs to be fresh, put it under a hole — `loading()` for
576
583
loader data, or an un-awaited promise under the consumer's `<Suspense>`
577
-
(holes are never pinned) — or make the SHELL itself invalidatable by adding
578
-
the tag to `ppr.tags`. Ring-1/ring-3 tag invalidation does NOT drop the shell.
584
+
(holes are never pinned) — or make the SHELL itself invalidatable by tagging
0 commit comments