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 a9551a2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ppr): mask live-lane loaders for handler-side ctx.use during shell capture (#672)
The live-lane mask existed only in the segment funnel: resolveLoaderData
returned a masked promise for the SEGMENT but never primed the per-request
loaderPromises map that handler-side ctx.use consults, so a slot handler
awaiting ctx.use(SlotLoader) executed the loader body inline during capture.
A cookies()-reading loader then tripped the identity guard and the capture
was refused forever (x-rango-shell: MISS permanently). Contrary to the
issue's framing, this affected EVERY route, not just non-index ones — the
reported working "/" was a stale-shell artifact; reproduced at full
router.match fidelity on both routes.
Fix, two halves:
- primeShellCaptureLoaderMasks (loader-mask.ts), called from
createMatchContextForFull when capture is active: walks entries incl.
parallel slots and orphan layouts, collects exclusively-live-lane loader
ids (dual-lane ids keep the per-entry funnel), and primes loaderPromises
with masked promises so any ctx.use hands out the mask.
- Settled release: a masked handler never settles, which would hang
handleStore.settled (quiesce + handles row) into a maxWaitMs stall and
no-shell. ctx.use fires a per-segment release deferred at masked hand-out;
trackHandler (capture only) tracks Promise.race([handler, release]) while
returning the original promise so the boundary still postpones.
Also: refuseOnGuardTrip no longer hardcodes the "bake-lane loader"
attribution — the guard records the tripping loader id (loader-body ALS now
carries loaderId) and the warning names the real origin; warnNullCaptureOnce
gains the awaited-masked-loader cause.
Tests: new shell-capture-live-lane-ctx-use.test.ts (full createRouter→match
capture; red pre-fix on BOTH routes — loader body executed, guard tripped),
e2e slot-ctx.use fixture with two ppr routes in shell-cache.test.ts (red
pre-fix in dev, green post-fix; runs in dev + production describes). Full
router suite 4937 passed; e2e shell-cache 22/22 in both projects; consumer
dogfood suites green; gen files regenerated. Design docs updated
(ppr-shell-resume.md prime+release section, loader-container-bake.md note).
0 commit comments