Short-circuit detail page HEAD probes#1286
Conversation
Co-authored-by: Neil Raina <makeitraina@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: Learn More: https://vercel.link/multiple-function-regions |
Greptile SummaryThis PR adds a Next.js 16 proxy handler (
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to HEAD requests on a single route and does not alter GET/POST or any existing page rendering logic. The proxy logic is correct: HEAD returns a well-formed null-body 200 with no-store, and all other methods are forwarded untouched. The matcher pattern is valid Next.js 16 syntax, the file is placed correctly under src/, and the jest config uses nextJest so NextResponse is available without manual mocking. The test-file issues raised in prior threads (internal header assertion, unsafe cast) are code quality nits that do not affect production behavior. No files require special attention. src/proxy.test.ts has minor test-quality issues already noted in prior review threads. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Proxy as src/proxy.ts (Next.js 16 Proxy)
participant Route as /detail/[task_id]/[user_type]
participant DB as Supabase / Prisma
Client->>Proxy: HEAD /detail/:task_id/:user_type
Proxy-->>Client: 200 OK, Cache-Control: no-store (no body)
Client->>Proxy: GET /detail/:task_id/:user_type
Proxy->>Route: NextResponse.next() (pass-through)
Route->>DB: TasksService.getTraversalPath(...)
DB-->>Route: result
Route-->>Client: 200 OK (rendered page)
Reviews (2): Last reviewed commit: "remove proxy test" | Re-trigger Greptile |
|
@greptileai re review this pr |
Changes
proxyhandler for/detail/:task_id/:user_typethat returns an empty200withCache-Control: no-storefor HEAD requests.Testing Criteria
yarn test src/proxy.test.ts --runInBandpasses.yarn lint:checkpasses with existing warnings only.yarn tsc --noEmitstill fails on the known pre-existingsrc/icons/index.tsSVG module declaration errors.PORT=3012 yarn dev:curl -i -X HEAD "http://localhost:3012/detail/92149834-0854-483b-bd14-2bed91d1182a/cu?token=test-token"returnsHTTP/1.1 200 OKandcache-control: no-storewithout compiling/rendering/detail/[task_id]/[user_type].200, existing invalid-token UI), confirming the proxy is scoped to HEAD.resolves OUT-3802 OUT-3802: TypeError: fetch failed
Notes
/detail/[task_id]/[user_type]reachingTasksService.getTraversalPath, then failing when Prisma cannot reach the Supabase pooler. This PR prevents low-value HEAD probes from invoking detail-page DB work.Impact & Surface Area of Change
/detail/:task_id/:user_type.