Repository navigation
fix(sitemap): render per request; ISR cached a gig-less fallback - #593
Merged
Merged
Conversation
sitemap.xml served only the 23 static URLs. With revalidate=3600 the first render happens at `next build`, where the image has no SUPABASE_SERVICE_ROLE_KEY, so createServiceClient() threw and the static-only fallback was cached and served after every deploy: no gigs, profiles, posts, skills or blog posts for crawlers. force-dynamic renders it per request; the fallback now logs why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan47 finding(s) HIGH/CRITICAL: 1 | MEDIUM: 8 | LOW: 38
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
https://ugig.net/sitemap.xml lists only the 23 static URLs: no gigs, profiles, posts, skills or blog posts. The response is
x-nextjs-cache: HIT.With
revalidate = 3600, the first render happens duringnext build. The build has noSUPABASE_SERVICE_ROLE_KEY(onlyNEXT_PUBLIC_*build args), socreateServiceClient()throws, thecatchreturns the static pages, and that result is cached. Every deploy starts the cycle again. The app container does have the key.Fix
export const dynamic = "force-dynamic": the sitemap renders per request (6 indexed selects).console.errorthe reason instead of hiding it.Tests
New
src/app/sitemap.test.ts:is_spam = false(the fix(seo): keep spam-flagged profiles out of search engines #587 rule);I'll check the live URL count after deploy.
🤖 Generated with Claude Code