Visitar URL original
fix(layout): guard against null matchProvider in useOnboardingRedirect by sentry[bot] · Pull Request #4144 · codecov/gazebo · GitHub
Skip to content

fix(layout): guard against null matchProvider in useOnboardingRedirect - #4144

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/null-matchprovider-onboarding-redirect
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/null-matchprovider-onboarding-redirect

Conversation

@sentry

@sentry sentry Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Description

Fixes an issue where useRouteMatch('/gh') returns null when a user visits non-GitHub routes (e.g. /bitbucket/...). Accessing .isExact on matchProvider was causing a TypeError: null is not an object (evaluating 'r.isExact') runtime error.

This adds an early return check if (!matchProvider) return in useOnboardingRedirect before attempting to access properties on matchProvider.

Legal Boilerplate

Look, I get it. The entity doing business as "Codecov" is owned by Harness, Inc. In 2026 Harness acquired Codecov and as a result Harness 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 Harness can use, modify, copy, and redistribute my contributions, under Harness's choice of terms.

Fixes GAZEBO-18A4

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.


Note

Low Risk
Single early-return guard in layout onboarding redirect; no auth or data-path changes.

Overview
Fixes a runtime crash when users hit non-GitHub routes (e.g. Bitbucket) while the base layout still runs onboarding redirect logic.

useOnboardingRedirect now returns early when useRouteMatch('/gh') is null, so it no longer reads matchProvider.isExact outside GitHub onboarding URLs.

Reviewed by Cursor Bugbot for commit 0c80dff. Bugbot is set up for automated code reviews on this repo. Configure here.

@sentry

sentry Bot commented Oct 22, 2026

Copy link
Copy Markdown
Author

⚠️ Sentry needs additional GitHub App permissions

The Sentry GitHub App installation for this repository is missing permissions it needs to keep iterating on this pull request to get CI passing.

Review and accept the updated permissions to let Seer continue: https://github.com/organizations/codecov/settings/installations/86101127/permissions/update

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.82MB 13 bytes (0.0%) ⬆️
gazebo-production-esm 5.89MB 4 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 13 bytes 657.83kB 0.0%

Files in assets/index-legacy.*.js:

  • ./src/layouts/BaseLayout/hooks/useUserAccessGate.js → Total Size: 2.94kB
view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 4 bytes 577.82kB 0.0%

Files in assets/index.*.js:

  • ./src/layouts/BaseLayout/hooks/useUserAccessGate.js → Total Size: 2.94kB

This branch has not been deployed

No deployments
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