ampproject / ampproject/amphtml

amp-story-shopping validation is performed on non-existent shopping tags

Open
#38,076 1 comment 0 reactions 0 assignees View on GitHub
Component: amp-story-shopping P3: When Possible Stale Type: Bug WG: caching WG: stories
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.