Skip to content

Fix Sentry context ordering and add missing MERGED upload state case#3974

Closed
cursor[bot] wants to merge 2 commits intomainfrom
cursor/sentry-context-and-upload-states-c99e
Closed

Fix Sentry context ordering and add missing MERGED upload state case#3974
cursor[bot] wants to merge 2 commits intomainfrom
cursor/sentry-context-and-upload-states-c99e

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Mar 16, 2026

Description

This PR fixes two bugs found during code review:

  1. Sentry context ordering: Fixed the order of operations in rejectNetworkError.ts to ensure that setContext is called before captureException. This ensures that zod validation context (issues and error messages) is properly attached to Sentry events for parsing errors.

  2. Missing MERGED state case: Added a case for the merged state in the humanReadableOverview function in extractUploads.ts. Without this case, uploads with the MERGED state would show as "undefined" in the uploads overview string.

Notable Changes

  • Moved scope.setContext('zod_validation', ...) call before scope.captureException(err) in src/shared/api/rejectNetworkError.ts
  • Added case for UploadStateEnum.merged returning 'merged' in humanReadableOverview function in src/shared/utils/extractUploads.ts
Open in Web Open in Cursor 

calvin-codecov and others added 2 commits March 16, 2026 16:13
- Move setContext call before captureException to ensure zod validation context is attached to Sentry events
- Add case for merged state in humanReadableOverview to prevent undefined in uploads overview
@sentry
Copy link
Copy Markdown

sentry bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.54%. Comparing base (3894269) to head (f0286a6).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/shared/utils/extractUploads.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           cy/add_merged_upload_state    #3974      +/-   ##
==============================================================
- Coverage                       98.56%   98.54%   -0.02%     
==============================================================
  Files                             826      826              
  Lines                           15221    15223       +2     
  Branches                         4459     4460       +1     
==============================================================
  Hits                            15002    15002              
- Misses                            212      214       +2     
  Partials                            7        7              
Files with missing lines Coverage Δ
src/shared/api/rejectNetworkError.ts 95.12% <100.00%> (ø)
src/shared/utils/extractUploads.ts 97.80% <0.00%> (-2.20%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.06% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.80% <33.33%> (-0.14%) ⬇️
UI 99.01% <ø> (ø)

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 3894269...f0286a6. Read the comment docs.

@codecov-notifications
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/shared/utils/extractUploads.ts 0.00% 2 Missing ⚠️
@@                      Coverage Diff                       @@
##           cy/add_merged_upload_state    #3974      +/-   ##
==============================================================
- Coverage                       98.56%   98.54%   -0.02%     
==============================================================
  Files                             826      826              
  Lines                           15221    15223       +2     
  Branches                         4451     4460       +9     
==============================================================
  Hits                            15002    15002              
- Misses                            212      214       +2     
  Partials                            7        7              
Files with missing lines Coverage Δ
src/shared/api/rejectNetworkError.ts 95.12% <100.00%> (ø)
src/shared/utils/extractUploads.ts 97.80% <0.00%> (-2.20%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.06% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.80% <33.33%> (-0.14%) ⬇️
UI 99.01% <ø> (ø)

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 3894269...f0286a6. Read the comment docs.

@codecov-public-qa
Copy link
Copy Markdown

codecov-public-qa bot commented Mar 16, 2026

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 98.54%. Comparing base (df4d6e0) to head (f0286a6).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/shared/api/rejectNetworkError.ts 77.77% 2 Missing ⚠️
src/shared/utils/extractUploads.ts 0.00% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main    #3974      +/-   ##
==========================================
- Coverage   98.58%   98.54%   -0.04%     
==========================================
  Files         826      826              
  Lines       15214    15223       +9     
  Branches     4447     4460      +13     
==========================================
+ Hits        14999    15002       +3     
- Misses        208      214       +6     
  Partials        7        7              
Files with missing lines Coverage Δ
src/shared/utils/commit.ts 100.00% <ø> (ø)
src/shared/api/rejectNetworkError.ts 95.12% <77.77%> (-4.88%) ⬇️
src/shared/utils/extractUploads.ts 97.80% <0.00%> (-2.20%) ⬇️

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.06% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.80% <63.63%> (-0.27%) ⬇️
UI 99.01% <ø> (-0.15%) ⬇️

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 df4d6e0...f0286a6. 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
f0286a6 Mon, 16 Mar 2026 23:37:21 GMT Cloud Enterprise

@codecov-qa
Copy link
Copy Markdown

codecov-qa bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.54%. Comparing base (df4d6e0) to head (f0286a6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/shared/api/rejectNetworkError.ts 77.77% 2 Missing ⚠️
src/shared/utils/extractUploads.ts 0.00% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main    #3974      +/-   ##
==========================================
- Coverage   98.58%   98.54%   -0.04%     
==========================================
  Files         826      826              
  Lines       15214    15223       +9     
  Branches     4455     4452       -3     
==========================================
+ Hits        14999    15002       +3     
- Misses        208      214       +6     
  Partials        7        7              
Files with missing lines Coverage Δ
src/shared/utils/commit.ts 100.00% <ø> (ø)
src/shared/api/rejectNetworkError.ts 95.12% <77.77%> (-4.88%) ⬇️
src/shared/utils/extractUploads.ts 97.80% <0.00%> (-2.20%) ⬇️

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.06% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.80% <63.63%> (-0.27%) ⬇️
UI 99.01% <ø> (-0.15%) ⬇️

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 df4d6e0...f0286a6. 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.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 17, 2026

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.87MB 29 bytes (0.0%) ⬆️
gazebo-production-esm 5.96MB 31 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/CIStatus-legacy.*.js 29 bytes 17.87kB 0.16%

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

  • ./src/shared/utils/extractUploads.ts → Total Size: 4.24kB
view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 1 bytes 49.15kB 0.0%
assets/index.*.js 1 bytes 638.77kB 0.0%
assets/CIStatus.*.js 29 bytes 18.5kB 0.16%

Files in assets/index.*.js:

  • ./src/shared/api/rejectNetworkError.ts → Total Size: 1.57kB

Files in assets/CIStatus.*.js:

  • ./src/shared/utils/extractUploads.ts → Total Size: 4.21kB

Base automatically changed from cy/add_merged_upload_state to main March 17, 2026 20:41
@cursor cursor bot closed this Mar 17, 2026
@cursor
Copy link
Copy Markdown
Author

cursor bot commented Mar 17, 2026

Automatically closed this PR because it was created by Bugbot autofix for #3973, and that PR was closed.

@cursor cursor bot deleted the cursor/sentry-context-and-upload-states-c99e branch March 17, 2026 21:31
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.

3 participants