Skip to content

Conversation

@getsantry
Copy link
Contributor

@getsantry getsantry bot commented Sep 23, 2025

No description provided.

@getsantry getsantry bot enabled auto-merge (squash) September 23, 2025 16:17
Comment on lines +11 to 12
const SENTRY_API_SCHEMA_SHA = 'b7dd6d5bb8c9cb43c43513717617666b8cfb52ac';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: The resolveOpenAPI function lacks an error check after a fetch call, causing an unhandled SyntaxError if the response is not valid JSON, crashing API documentation pages.
  • Description: The resolveOpenAPI function fetches an OpenAPI schema from a raw.githubusercontent.com URL. It does not validate the HTTP response status before attempting to parse the body as JSON with response.json(). If the fetch request fails (e.g., due to an invalid commit SHA, network error, or GitHub service issue), the server will likely return a non-200 response with an HTML body. Calling response.json() on this HTML will throw a SyntaxError. This unhandled exception will propagate up to the page rendering logic, causing a server-side crash for any user visiting an API documentation page.

  • Suggested fix: Before calling await response.json(), check if the response was successful using if (!response.ok). If the response is not ok, throw a descriptive error like new Error('Failed to fetch API schema') to prevent the JSON parsing error and provide clearer failure information.
    severity: 0.65, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

@codecov
Copy link

codecov bot commented Sep 23, 2025

Bundle Report

Changes will increase total bundle size by 42 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 12.86MB 42 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
server/middleware-*.js -6.46kB 1.0kB -86.59%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.78MB -0.0%
../instrumentation.js 48 bytes 1.1MB 0.0%
9523.js -3 bytes 1.08MB -0.0%

@vercel
Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Sep 23, 2025 4:51pm
sentry-docs Ready Ready Preview Comment Sep 23, 2025 4:51pm

@getsantry getsantry bot merged commit 412d9eb into master Sep 23, 2025
15 checks passed
@getsantry getsantry bot deleted the bot/bump-api-schema-to-b7dd6d5b branch September 23, 2025 19:23
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants