Enforce strict shipping tag parsing across product reads#341
Merged
calvadev merged 4 commits intoshopstr-eng:mainfrom Apr 14, 2026
Merged
Enforce strict shipping tag parsing across product reads#341calvadev merged 4 commits intoshopstr-eng:mainfrom
calvadev merged 4 commits intoshopstr-eng:mainfrom
Conversation
|
@vagxrth is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@calvadev @GautamBytes can you review this PR? |
kaihere14
reviewed
Apr 5, 2026
Contributor
kaihere14
left a comment
There was a problem hiding this comment.
Good cleanup, centralizing the shipping logic makes sense. A couple things:
- getEffectiveShippingCost returns 0 for both malformed tags and genuinely free shipping — callers can't tell
the difference. Worth returning null for the missing case. - Negative costs will pass Number.isFinite() — add a >= 0 check in parseShippingTag.
- Quick grep worth doing to make sure no components are still doing raw tag[1]/tag[2] access and bypassing the
new helper.
Tests look solid otherwise. LGTM with those addressed
Contributor
|
@vagxrth please address first 2 comments of @kaihere14 and solve merge conflict then its good to merge |
Contributor
|
LGTM |
calvadev
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
shippingtags so only the modern format["shipping", type, cost, currency]is accepted.Resolved or fixed issue
Fixes #275
Screenshots (if applicable)
none
Affirmation