Skip to content

fix(browser): Guard ResizeObserver for older Safari versions - #4113

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/resize-observer-safari-12
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/resize-observer-safari-12

Conversation

@sentry

@sentry sentry Bot commented Sep 8, 2026

Copy link
Copy Markdown

Description

This PR addresses a ReferenceError: Can't find variable: ResizeObserver occurring on iOS 12 / Safari 12 when navigating to commit detail pages.

The root cause was the unconditional instantiation of ResizeObserver within the useTruncation hook. ResizeObserver is not supported in Safari versions prior to 13.1.

Code Example

const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(...) : null;

Notable Changes

The fix involves adding a typeof ResizeObserver !== 'undefined' check before instantiating ResizeObserver. If ResizeObserver is not available, null is returned, allowing the useTruncation hook to degrade gracefully without crashing the application. This ensures that users on older browsers can still access the page, albeit without the truncation functionality.

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-186P

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

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.82MB 40 bytes (0.0%) ⬆️
gazebo-production-esm 5.89MB 31 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 31 bytes 126.43kB 0.02%

Files in assets/index.*.js:

  • ./src/ui/TruncatedMessage/hooks/useTruncation.ts → Total Size: 1.18kB
view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 40 bytes 114.93kB 0.03%

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

  • ./src/ui/TruncatedMessage/hooks/useTruncation.ts → Total Size: 1.18kB

@sentry

sentry Bot commented Sep 8, 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 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.76%. Comparing base (b8fbfc0) to head (981fe22).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/TruncatedMessage/hooks/useTruncation.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   98.77%   98.76%   -0.01%     
==========================================
  Files         823      823              
  Lines       15147    15150       +3     
  Branches     4387     4390       +3     
==========================================
+ Hits        14961    14963       +2     
- Misses        179      180       +1     
  Partials        7        7              
Files with missing lines Coverage Δ
src/ui/TruncatedMessage/hooks/useTruncation.ts 96.66% <75.00%> (-3.34%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 98.95% <75.00%> (-0.07%) ⬇️

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...981fe22. Read the comment docs.

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/TruncatedMessage/hooks/useTruncation.ts 75.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   98.77%   98.76%   -0.01%     
==========================================
  Files         823      823              
  Lines       15147    15150       +3     
  Branches     4387     4381       -6     
==========================================
+ Hits        14961    14963       +2     
- Misses        179      180       +1     
  Partials        7        7              
Files with missing lines Coverage Δ
src/ui/TruncatedMessage/hooks/useTruncation.ts 96.66% <75.00%> (-3.34%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 98.95% <75.00%> (-0.07%) ⬇️

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...981fe22. Read the comment docs.

@codecov-public-qa

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.76%. Comparing base (b8fbfc0) to head (981fe22).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/TruncatedMessage/hooks/useTruncation.ts 75.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   98.77%   98.76%   -0.01%     
==========================================
  Files         823      823              
  Lines       15147    15150       +3     
  Branches     4379     4390      +11     
==========================================
+ Hits        14961    14963       +2     
- Misses        179      180       +1     
  Partials        7        7              
Files with missing lines Coverage Δ
src/ui/TruncatedMessage/hooks/useTruncation.ts 96.66% <75.00%> (-3.34%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 98.95% <75.00%> (-0.07%) ⬇️

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...981fe22. 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.

@codecov-releaser

Copy link
Copy Markdown
Collaborator

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
981fe22 Tue, 08 Sep 2026 22:52:53 GMT Cloud Enterprise

@codecov-qa

codecov-qa Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.76%. Comparing base (b8fbfc0) to head (981fe22).

Files with missing lines Patch % Lines
src/ui/TruncatedMessage/hooks/useTruncation.ts 75.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   98.77%   98.76%   -0.01%     
==========================================
  Files         823      823              
  Lines       15147    15150       +3     
  Branches     4387     4381       -6     
==========================================
+ Hits        14961    14963       +2     
- Misses        179      180       +1     
  Partials        7        7              
Files with missing lines Coverage Δ
src/ui/TruncatedMessage/hooks/useTruncation.ts 96.66% <75.00%> (-3.34%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 98.95% <75.00%> (-0.07%) ⬇️

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...981fe22. 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