Skip to content

fix(react): Safely validate inventory in ProductCard#1330

Draft
sentry[bot] wants to merge 1 commit intomasterfrom
seer/fix/safe-inventory-validation
Draft

fix(react): Safely validate inventory in ProductCard#1330
sentry[bot] wants to merge 1 commit intomasterfrom
seer/fix/safe-inventory-validation

Conversation

@sentry
Copy link
Contributor

@sentry sentry bot commented Mar 4, 2026

Fixes REACT-60Z. The issue was that: inventory is undefined because addToCartJsError flag, set by cexp query parameter, intentionally causes it.

  • Added a null/undefined check for the inventory variable before calling .includes() in validate_inventory to prevent potential runtime errors.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 10075049

Not quite right? Click here to continue debugging with Seer.

@vercel
Copy link
Contributor

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
empower Ignored Ignored Preview Mar 4, 2026 9:44pm

Request Review

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 22.01%. Comparing base (7d0d8c6) to head (cab2244).
⚠️ Report is 23 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
react/src/components/ProductCard.jsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1330      +/-   ##
==========================================
- Coverage   22.01%   22.01%   -0.01%     
==========================================
  Files          42       42              
  Lines        1349     1363      +14     
  Branches      174      176       +2     
==========================================
+ Hits          297      300       +3     
- Misses       1026     1036      +10     
- Partials       26       27       +1     
Flag Coverage Δ
api 5.83% <ø> (ø)
frontend 32.33% <0.00%> (-0.19%) ⬇️
Components Coverage Δ
checkout_module 5.83% <ø> (ø)
product_component 25.98% <0.00%> (-0.15%) ⬇️
Files with missing lines Coverage Δ
react/src/components/ProductCard.jsx 71.42% <0.00%> (ø)

... and 6 files with indirect coverage changes

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