Skip to content

fix: Handle NotFoundError gracefully on pull page#3986

Draft
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/pull-page-notfound-error
Draft

fix: Handle NotFoundError gracefully on pull page#3986
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/pull-page-notfound-error

Conversation

@sentry

@sentry sentry Bot commented May 31, 2026

Copy link
Copy Markdown

Description

This PR addresses GAZEBO-17YY, where users encountered an unhandled JavaScript error (minified as "Error: fe") when navigating to a pull request page for a repository that does not exist in Codecov.

Code Example

PullPageDataQueryOpts
useSuspenseQueryV5
rejectNetworkError
PullRequestPage.tsx
if (!isPending && !data?.pull) return <NotFound />

Notable Changes

Root Cause:
The PullPageDataQueryOpts query, used by useSuspenseQueryV5 in PullRequestPage.tsx, was calling rejectNetworkError when a NotFoundError was returned by the GraphQL API. In suspense mode, useSuspenseQueryV5 re-throws rejected promises during render, leading to an unhandled exception because there was no error boundary specifically catching this type of rejection on the pull page.

Solution:
Instead of calling rejectNetworkError when PullPageDataQueryOpts receives a NotFoundError from the GraphQL API, the query now returns null for pull, coverageEnabled, and bundleAnalysisEnabled fields. This allows the existing null-check (if (!isPending && !data?.pull) return <NotFound />) in PullRequestPage.tsx to correctly identify the non-existent repository and render the <NotFound /> component gracefully, preventing the unhandled error.

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes GAZEBO-17YY

@sentry

sentry Bot commented May 31, 2026

Copy link
Copy Markdown
Author

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5726 1 5725 3
View the top 1 failed test(s) by shortest run time
src/pages/PullRequestPage/queries/PullPageDataQueryOpts.test.tsx > PullPageDataQueryOpts > calling hook > returns NotFoundError __typename > throws a 404
Stack Traces | 1.02s run time
AssertionError: expected false to be truthy

Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div />
  </body>
</html>

- Expected
+ Received

- true
+ false

 ❯ .../PullRequestPage/queries/PullPageDataQueryOpts.test.tsx:282:60
 ❯ runWithExpensiveErrorDiagnosticsDisabled node_modules/@.../dom/dist/config.js:47:12
 ❯ checkCallback node_modules/@.../dom/dist/wait-for.js:124:77
 ❯ Timeout.checkRealTimersCallback node_modules/@.../dom/dist/wait-for.js:118:16

@sentry

sentry Bot commented May 31, 2026

Copy link
Copy Markdown
Author

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-esm 5.96MB -1 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js -1 bytes 125.68kB -0.0%

Files in assets/index.*.js:

  • ./src/pages/PullRequestPage/queries/PullPageDataQueryOpts.tsx → Total Size: 5.69kB

@codecov-public-qa

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5726 1 5725 3
View the top 1 failed test(s) by shortest run time
src/pages/PullRequestPage/queries/PullPageDataQueryOpts.test.tsx > PullPageDataQueryOpts > calling hook > returns NotFoundError __typename > throws a 404
Stack Traces | 1.02s run time
AssertionError: expected false to be truthy

Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div />
  </body>
</html>

- Expected
+ Received

- true
+ false

 ❯ .../PullRequestPage/queries/PullPageDataQueryOpts.test.tsx:282:60runWithExpensiveErrorDiagnosticsDisabled node_modules/@.../dom/dist/config.js:47:12checkCallback node_modules/@.../dom/dist/wait-for.js:124:77Timeout.checkRealTimersCallback node_modules/@.../dom/dist/wait-for.js:118:16

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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