From 84176af515bbc1004b83dc5c69b216523b6b372e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 13 Aug 2026 19:11:57 +0200 Subject: [PATCH] Enrol the two new prefetching pages in their structural guards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prefetch-caching guard's frozen route set and the session-surface guard's direct-derivation list both name every RSC prefetch wrapper; /checkups and /mood join them with the same reasoning as their five predecessors — getUnswitchedSession only, skipped under a switch. --- src/__tests__/prefetch-page-caching-guard.test.ts | 2 ++ src/__tests__/session-surface-guard.test.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/__tests__/prefetch-page-caching-guard.test.ts b/src/__tests__/prefetch-page-caching-guard.test.ts index 54c19d195..883bb2c9d 100644 --- a/src/__tests__/prefetch-page-caching-guard.test.ts +++ b/src/__tests__/prefetch-page-caching-guard.test.ts @@ -172,10 +172,12 @@ const prefetchingPages = walk(APP_DIR) */ const PREFETCHING_ROUTES = [ "/", + "/checkups", "/coach", "/insights", "/insights/workouts", "/medications", + "/mood", ] as const; describe("server-prefetching pages cannot leak a cacheable record", () => { diff --git a/src/__tests__/session-surface-guard.test.ts b/src/__tests__/session-surface-guard.test.ts index a1e42ed56..dd822043e 100644 --- a/src/__tests__/session-surface-guard.test.ts +++ b/src/__tests__/session-surface-guard.test.ts @@ -105,7 +105,7 @@ describe("S1 — the direct session-resolution set is frozen", () => { // with the session user's own data. Absence of a session skips the // prefetch rather than failing the render. // - // These five resolve through `getUnswitchedSession()`, not `getSession()`, + // These seven resolve through `getUnswitchedSession()`, not `getSession()`, // and they stay listed here BECAUSE of it. The helper is still a session // derivation outside `requireAuth` — moving the call one file deeper into // `lib/` would have taken them off this list while changing nothing about @@ -115,6 +115,8 @@ describe("S1 — the direct session-resolution set is frozen", () => { // can only ever hold the caller's own. See // `prefetch-page-caching-guard.test.ts` for the rule that keeps a sixth // prefetching page from reaching for the bare helper. + "app/checkups/page.tsx": + "RSC prefetch of the session user's reminder list, skipped under a switch", "app/coach/page.tsx": "RSC prefetch of the session user's coach state, skipped under a switch", "app/insights/page.tsx": @@ -123,6 +125,8 @@ describe("S1 — the direct session-resolution set is frozen", () => { "RSC prefetch of the session user's workouts, skipped under a switch", "app/medications/page.tsx": "RSC prefetch of the session user's medications, skipped under a switch", + "app/mood/page.tsx": + "RSC prefetch of the session user's mood list, skipped under a switch", "app/page.tsx": "RSC prefetch of the session user's dashboard snapshot, skipped under a switch", // Onboarding routing. Reads the actor's own onboarding step to redirect;