Repository navigation
feat(shopping): classify merchant destinations and listing IDs - #1242
Merged
gkhngyk merged 10 commits intoOct 20, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
gkhngyk
requested changes
Oct 20, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Thanks, a clean library for #1186. It makes no network calls, fails safely on bad input, and the listing-ID rules match the issue. Two fixes before merge, since the classifier's answers are the point:
- Relative redirect targets are read as hosts.
redirectTargetcallsparseHttpUrlbefore its relative branch.parseHttpUrl('/ip/Blue-Coat/123')retries ashttps:///ip/..., whose hostname isip, sogoto.walmart.com/?u=%2Fip%2F…comes out asreseller.u=foobecomes hostfoothe same way. For redirect parameters, check for a leading/first and accept only explicithttp(s)://values; otherwise fall back to the redirect host's marketplace. Please add fixtures for both cases. - Host list gaps in
merchant-marketplaces.json. All of these come out asresellertoday:- Amazon Belgium is
amazon.com.be; the list hasamazon.be. amazon.co.za,ebay.atandebay.chare missing.- So are the short-link hosts
amzn.to,amzn.eu,a.coandebay.us.
- Amazon Belgium is
Smaller:
isOwnDomainre-implementsownDomainMatcher(server/src/lib/response-parser.js). Reusing it keeps "own" the same as on Citations.- Add a fixture for Amazon's
/<slug>/dp/<ASIN>/ref=…URLs.
This was referenced Oct 20, 2026
gkhngyk
approved these changes
Oct 20, 2026
This was referenced Oct 20, 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.
Summary
classifyMerchant(merchantUrl, { brandDomains })helper that returnskind,marketplace, andlistingId.s.click.aliexpress.com?dl_target_url=…, `goto.walmart.com?u=…)); do not follow arbitrary redirect links.Related issue
Closes #1186
Type of change
Validation
npm testfromserver/— 1,848 tests passed (including 30 new merchant-detection cases)npm run lintfromserver/npm run format:checkfromserver/feature/naming convention