Skip to content

Conversation

getsantry[bot]
Copy link
Contributor

@getsantry getsantry bot commented Sep 19, 2025

No description provided.

@getsantry getsantry bot enabled auto-merge (squash) September 19, 2025 15:33
Copy link

vercel bot commented Sep 19, 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 19, 2025 4:05pm
sentry-docs Ready Ready Preview Comment Sep 19, 2025 4:05pm

Comment on lines 12 to 13

const activeEnv = process.env.GATSBY_ENV || process.env.NODE_ENV || 'development';
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 doesn't handle non-200 HTTP responses from fetch before calling response.json(), which can cause a crash if the external API returns an error.
  • Description: The resolveOpenAPI function fetches an OpenAPI schema from a raw GitHub URL. It directly calls response.json() on the result without first checking if the HTTP request was successful (e.g., via response.ok). If the fetch fails for any reason, such as a 404 error or a temporary GitHub outage, the response will likely be an HTML error page. Attempting to parse this HTML as JSON will throw a SyntaxError, causing an unhandled exception. This will crash the documentation build process and also cause server-side rendering failures for API documentation pages, as the function is used in both critical paths.

  • Suggested fix: Before calling await response.json(), add a check for the response status. If !response.ok, throw an informative error to prevent the application from crashing due to an attempt to parse a non-JSON response. For example: if (!response.ok) { throw new Error(Failed to fetch OpenAPI schema: ${response.statusText}); }.
    severity: 0.7, confidence: 0.95

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

Copy link

codecov bot commented Sep 19, 2025

Bundle Report

Changes will decrease total bundle size by 15 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.12MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.85MB -9 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

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 -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
server/middleware-*.js -6.46kB 1.0kB -86.59%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
static/1Ej88gWebmiHr6wFcxOXi/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/1Ej88gWebmiHr6wFcxOXi/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/ksYV6kpzm5wjh2e7lxXlQ/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/ksYV6kpzm5wjh2e7lxXlQ/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants