Skip to content

fix(browser): Replace Array.at() with slice() for broader compatibility - #4111

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/gazebo-16zw-array-at-compat
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/gazebo-16zw-array-at-compat

Conversation

@sentry

@sentry sentry Bot commented Sep 7, 2026

Copy link
Copy Markdown

Description

This PR addresses GAZEBO-16ZW by replacing Array.prototype.at(-1) with Array.prototype.slice(-1)[0] in getFilenameFromPath and getFileExtension. The TypeError: e.split(...).at is not a function error was occurring in older or non-standard browser environments because Array.prototype.at is an ES2022 feature not universally supported. This change ensures that these functions work correctly across a wider range of client engines, preventing the RawFileViewer ErrorBoundary from being triggered on blob file pages.

Code Example

Before: someArray.at(-1)
After: someArray.slice(-1)[0]

Notable Changes

  • Replaced Array.prototype.at(-1) with Array.prototype.slice(-1)[0] in getFilenameFromPath and getFileExtension within src/shared/utils/url.ts.
  • This change improves browser compatibility for these utility functions, specifically addressing issues in environments that do not support ES2022's Array.prototype.at.
  • Prevents RawFileViewer ErrorBoundary from being triggered on blob file pages due to TypeError: e.split(...).at is not a function.

Screenshots

Link to Sample Entry

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-16ZW

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

@sentry

sentry Bot commented Sep 7, 2026

Copy link
Copy Markdown
Author

⚠️ Seer needs additional GitHub permissions

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.

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

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.82MB 11 bytes (0.0%) ⬆️
gazebo-production-esm 5.89MB -3 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/RawFileViewer.*.js -3 bytes 127.17kB -0.0%

Files in assets/RawFileViewer.*.js:

  • ./src/shared/utils/url.ts → Total Size: 619 bytes
view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/RawFileViewer-legacy.*.js 11 bytes 127.4kB 0.01%

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

  • ./src/shared/utils/url.ts → Total Size: 633 bytes

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #4111      +/-   ##
==========================================
+ Coverage   98.77%   98.78%   +0.01%     
==========================================
  Files         823      823              
  Lines       15147    15147              
  Branches     4387     4387              
==========================================
+ Hits        14961    14963       +2     
+ Misses        179      177       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/shared/utils/url.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <100.00%> (ø)
UI 99.16% <ø> (+0.13%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...19de9f6. Read the comment docs.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (b8fbfc0) to head (19de9f6).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4111      +/-   ##
==========================================
+ Coverage   98.77%   98.78%   +0.01%     
==========================================
  Files         823      823              
  Lines       15147    15147              
  Branches     4387     4387              
==========================================
+ Hits        14961    14963       +2     
+ Misses        179      177       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/shared/utils/url.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <100.00%> (ø)
UI 99.16% <ø> (+0.13%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...19de9f6. Read the comment docs.

@codecov-releaser

Copy link
Copy Markdown
Collaborator

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
19de9f6 Mon, 07 Sep 2026 10:52:14 GMT Cloud Enterprise

@codecov-qa

codecov-qa Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (b8fbfc0) to head (19de9f6).

@@            Coverage Diff             @@
##             main    #4111      +/-   ##
==========================================
+ Coverage   98.77%   98.78%   +0.01%     
==========================================
  Files         823      823              
  Lines       15147    15147              
  Branches     4387     4387              
==========================================
+ Hits        14961    14963       +2     
+ Misses        179      177       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/shared/utils/url.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <100.00%> (ø)
UI 99.16% <ø> (+0.13%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...19de9f6. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant