Skip to content

Validate fabric-length pricing in cart transform sample - #663

Merged
kirakik merged 2 commits into
Shopify:mainfrom
madmath:secfix/16-fabric-price-validation
Oct 29, 2026
Merged

kirakik merged 2 commits into
Shopify:mainfrom
madmath:secfix/16-fabric-price-validation

Conversation

@madmath

@madmath madmath commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Harden fabric-length pricing validation in the cart-transform sample while leaving the original price unchanged when an update is rejected.

Compatibility review needed: this retains the existing two-decimal pricing convention. Merchant-defined length minimums and allowed increments remain a separate design decision; this patch does not implement a complete merchant pricing policy.

Validation from the extension directory (Node 22.15.0):

  • npm test: 6/6 pass. With the new tests but without the fix, 2 fail and 4 pass.
  • node_modules/.bin/graphql-codegen --config package.json: passes.
  • node_modules/.bin/tsc --allowJs --checkJs --noEmit --target es2020 --moduleResolution node src/run.js: passes, also with --strict (TypeScript 4.9.5).
  • npm run build: blocked before Wasm compilation by duplicate GraphQL modules, on both original and patched code. Wasm output is unverified.
  • git diff --check: passes. Full repository suites were not run.

CI follow-up: fe6b0c2 removes a redundant borrow in the pickup-point Rust sample without changing behavior. Rust CI, JavaScript, TypeScript, and CLA checks all pass on the updated head. Local formatting and the six JavaScript sample tests also pass; local Rust compilation was blocked by dependency build scripts receiving SIGKILL.

Co-authored-by: River <river@shopify.com>
@madmath
madmath marked this pull request as ready for review October 29, 2026 15:15
@madmath

madmath commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@stephanie-shopify could you review this change? Please see the description for compatibility questions and verification limitations.

Fix useless_borrows_in_formatting without suppressing warnings or changing the formatted weekday value.
@kirakik
kirakik merged commit bbc6d12 into Shopify:main Oct 29, 2026
4 checks passed
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.

2 participants