fix(events): serve events sitemap at /event/sitemap.xml and stop backend calls for non-numeric IDs#1088
Open
pr0m3th3usEx wants to merge 5 commits into
Open
fix(events): serve events sitemap at /event/sitemap.xml and stop backend calls for non-numeric IDs#1088pr0m3th3usEx wants to merge 5 commits into
pr0m3th3usEx wants to merge 5 commits into
Conversation
❌ Deploy Preview for zenao failed.
|
/event/sitemap.xml: 1. **Events sitemap returned 404.** The events sitemap lived at app/(general)/event/[id]/sitemap.ts — *inside* the dynamic [id] segment. As a result /event/sitemap.xml was never served as a sitemap; instead [id] matched the literal string "sitemap.xml" and rendered the event page tree, which 404'd. 2. **Stray backend calls + error noise.** Because non-numeric segments reached the event page, eventOptions called zenaoClient.getEvent({ eventId: "sitemap.xml" }), and the backend failed with strconv.ParseUint: parsing "sitemap.xml": invalid syntax. These bot-triggered errors were captured by Sentry/OTel and added log noise. ## Changes
pr0m3th3usEx
force-pushed
the
fix-events-list-sitemap-not-found
branch
from
June 29, 2026 09:03
4d6d251 to
ba17add
Compare
pr0m3th3usEx
force-pushed
the
fix-events-list-sitemap-not-found
branch
from
June 29, 2026 09:06
ba17add to
39f659f
Compare
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
Two related issues surfaced from crawler/bot traffic hitting
/event/sitemap.xml:Events sitemap returned 404. The events sitemap lived at
app/(general)/event/[id]/sitemap.ts— inside the dynamic[id]segment. As aresult
/event/sitemap.xmlwas never served as a sitemap; instead[id]matchedthe literal string
"sitemap.xml"and rendered the event page tree, which 404'd.Stray backend calls + error noise. Because non-numeric segments reached the
event page,
eventOptionscalledzenaoClient.getEvent({ eventId: "sitemap.xml" }),and the backend failed with
strconv.ParseUint: parsing "sitemap.xml": invalid syntax.These bot-triggered errors were captured by Sentry/OTel and added log noise.
Changes
Move the events sitemap up one level:
app/(general)/event/[id]/sitemap.ts→app/(general)/event/sitemap.ts. Now/event/sitemap.xmlcorrectly serves the listof event URLs and no longer falls through to the
[id]page route. This mirrors theexisting blog pattern (
app/(general)/blog/sitemap.xml/route.tsx, a sibling of[slug]).Centralize a numeric-id guard in
eventOptions(lib/queries/event.ts): rejectnon-numeric IDs before hitting the backend, so crawler paths like
/event/<garbage>no longer trigger
getEvent/strconv.ParseUinterrors. All callers are covered;server pages' existing
try/catch → notFound()turns it into a clean 404.Remove redundant inline guards and debug logging that were previously sprinkled
in
event/[id]/(general)/layout.tsxand(tabs)/page.tsx, now that validation livesin one place.
Sentry source maps upload fix
Production/preview builds were failing source map upload with
error: Project not found. The Sentry config innext.config.tsstill used the wizard placeholders (org: "sentry",project: "zenao") and letsentry-clidefault its URL tosentry.io, which doesn't match our self-hosted instance atsentry.samourai.pro.Changes
next.config.ts: readorg/projectfromSENTRY_ORG_SLUG/SENTRY_PROJECT_SLUG, and setsentryUrlfromSENTRY_URLinstead of hardcoding/defaulting. Needed to be set in. Netlify.env.example: documentedSENTRY_ORG_SLUG,SENTRY_PROJECT_SLUG,SENTRY_URL,SENTRY_AUTH_TOKEN.SENTRY_AUTH_TOKEN(needs the org:ci scope; the previous token was invalid/exposed in build logs).Deployment note: these four env vars must be set in CI/hosting for source map upload to succeed. Upload is non-fatal and is already skipped in
development, so missing vars won't break builds — only stack-trace readability in Sentry.Testing
GET /event/sitemap.xml→200,content-type: application/xml, body listshttps://zenao.io/event/<id>entries; noGetEventerror in backend logs.GET /event/<non-numeric>→404with no backend call.GET /event/<valid-id>→200, event renders normally.