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 SummaryAdds a Next.js 16
Confidence Score: 5/5Safe to merge — the change is a small, targeted proxy handler that only intercepts HEAD requests on one specific path pattern; GET and all other methods are unaffected. The implementation is minimal and correct: correct file location for the Next.js 16 src/ layout, correct export name, valid matcher syntax, and a straightforward method check. The only gap is that the test file claimed in the PR description was not committed, but the logic itself is simple enough that this does not introduce risk to the existing detail page flows. No files require special attention; src/proxy.ts is the sole change and is self-contained. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Incoming request] --> B{Matches\n/detail/:task_id/:user_type?}
B -- No --> Z[Normal Next.js routing]
B -- Yes --> C{request.method\n=== 'HEAD'?}
C -- Yes --> D["NextResponse(null, 200)\nCache-Control: no-store\n(no DB call, no page render)"]
C -- No --> E["NextResponse.next()\n(passes to detail page handler)"]
E --> F[TasksService.getTraversalPath\n→ Prisma → Supabase pooler]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Incoming request] --> B{Matches\n/detail/:task_id/:user_type?}
B -- No --> Z[Normal Next.js routing]
B -- Yes --> C{request.method\n=== 'HEAD'?}
C -- Yes --> D["NextResponse(null, 200)\nCache-Control: no-store\n(no DB call, no page render)"]
C -- No --> E["NextResponse.next()\n(passes to detail page handler)"]
E --> F[TasksService.getTraversalPath\n→ Prisma → Supabase pooler]
Reviews (3): Last reviewed commit: "remove proxy test" | Re-trigger Greptile |
|
@greptileai re review this pr |
priosshrsth
left a comment
There was a problem hiding this comment.
lgtm. Let's try this. I think I checked this pr or another pr with similar changes to load the detail page. It was working for me. But once this is deployed lets test the detail page just in case.
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.