ampproject / ampproject/amphtml
amp-story-shopping validation is performed on non-existent shopping tags
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
Validation is performed per tag, regardless if the tag's product id exists or not.
We can do an early exit check even before validation by checking if the tag's product id actually exists within the dom.
### Reproduction Steps
Load any config with a tag with a productId that doesn't exist in the DOM.
Contributor guide
Research direction
Start at the amp-story-shopping validation entry point and reproduce the issue with a config whose productId is absent from the DOM. Trace how each shopping tag is validated, then verify that tags without matching DOM products are skipped before validation and that existing products retain their validation behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100