You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(FileListTable): Prevent crash when API returns null file entries - #4131
This PR addresses GAZEBO-187C, a TypeError occurring in the FileListTable when the API returns null entries within the file list data.
Previously, useRepoBranchContentsTable would map API results, returning null for any null API entry. These null values were then passed directly into the rawTableRows array, which is consumed by TanStack Table. When TanStack Table attempted to render cells for these null rows, it would try to access properties like .misses, .hits, or .coverage on a null object, leading to a TypeError.
The fix involves adding a .filter(Boolean) call to the rawTableRows array in src/pages/RepoPage/CoverageTab/OverviewTab/subroute/FileExplorer/hooks/useRepoBranchContentsTable.tsx. This ensures that any null entries are removed from the data before being passed to adjustListIfUpDir and subsequently to TanStack Table, thus preventing the error.
Code Example
// In src/pages/RepoPage/CoverageTab/OverviewTab/subroute/FileExplorer/hooks/useRepoBranchContentsTable.tsxconstrawTableRows=data?.results?.map(result=>{// ... existing mapping logic that might return null ...returnresult;// or null}).filter(Boolean);// Added this line to remove nulls
Notable Changes
Added .filter(Boolean) to the rawTableRows array in src/pages/RepoPage/CoverageTab/OverviewTab/subroute/FileExplorer/hooks/useRepoBranchContentsTable.tsx to prevent null entries from being passed to TanStack Table, resolving a TypeError.
Screenshots
N/A
Link to Sample Entry
N/A
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.
View the top 2 failed test(s) by shortest run time
src/pages/RepoPage/FailedTestsTab/FailedTestsPage/FailedTestsTable/FailedTestsTable.test.tsx > FailedTestsTable > renders table headers > when repo is private > when plan is free > does not render flake rate column
src/pages/RepoPage/FailedTestsTab/FailedTestsPage/FailedTestsTable/FailedTestsTable.test.tsx > FailedTestsTable > renders table headers > when repo is private > when plan is team plan > does not render flake rate column
Seer wants to keep iterating on this pull request to get CI passing, but the Sentry GitHub App installation is missing permissions it needs to read the failing checks and push a fix.
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
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.
Description
This PR addresses GAZEBO-187C, a TypeError occurring in the FileListTable when the API returns null entries within the file list data.
Previously,
useRepoBranchContentsTablewould map API results, returningnullfor any null API entry. Thesenullvalues were then passed directly into therawTableRowsarray, which is consumed by TanStack Table. When TanStack Table attempted to render cells for these null rows, it would try to access properties like.misses,.hits, or.coverageon anullobject, leading to aTypeError.The fix involves adding a
.filter(Boolean)call to therawTableRowsarray insrc/pages/RepoPage/CoverageTab/OverviewTab/subroute/FileExplorer/hooks/useRepoBranchContentsTable.tsx. This ensures that anynullentries are removed from the data before being passed toadjustListIfUpDirand subsequently to TanStack Table, thus preventing the error.Code Example
Notable Changes
Added
.filter(Boolean)to therawTableRowsarray insrc/pages/RepoPage/CoverageTab/OverviewTab/subroute/FileExplorer/hooks/useRepoBranchContentsTable.tsxto preventnullentries from being passed to TanStack Table, resolving aTypeError.Screenshots
N/A
Link to Sample Entry
N/A
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-187C
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.