Uh oh!
There was an error while loading. Please reload this page.
fix(chat): fail-safe to noindex if the deployment lookup errors - #5396
Conversation
generateMetadata queried the DB with no error handling, unlike the identical query in api/chat/[identifier]/route.ts (which already wraps it in try/catch). There's no error.tsx under app/(interfaces)/chat/ — metadata resolution errors aren't caught by route-segment error boundaries at all, only the root global-error.tsx — so a DB hiccup during this lookup would take the whole page down to a generic error page instead of just failing to determine indexability. Catches the error, logs it, and defaults to noindex: if we can't confirm the deployment is safely public, that's the correct SEO default anyway, not a reason to crash the request. Flagged by Cursor Bugbot on #5388 (already merged); this ships the fix as a standalone follow-up since the underlying code is already live.
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Comments document that this route has no segment Reviewed by Cursor Bugbot for commit 18fa798. Configure here. |
Summary
generateMetadataDB lookup had no error handling, unlike the identical query inapi/chat/[identifier]/route.tswhich already wraps it in try/catcherror.tsxunderapp/(interfaces)/chat/, and Next.js docs confirmgenerateMetadataresolves outside the rendered tree that route-segment error boundaries wrap — only the rootglobal-error.tsxwould catch a throw here, meaning a DB hiccup during this lookup would crash the whole page to a generic error page instead of degrading like the old static-metadata version didisIndexable = false. This is also just the correct default independent of the bug — if we can't confirm a deployment is safely public, noindex is the right call, not a 500Type of Change
Testing
Tested manually — live dev server, confirmed the success path (
noindex, nofollowfor a nonexistent identifier) is unchanged. Typecheck and Biome lint pass.Checklist