Repository navigation
Conversation
…al to the gift's keeps it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #1333
Follow-up to #1317 (PR #1321).
What (
product-normalizer.ts)13 năm,13 năm, ...). Any word or year form after it keeps the size: "năm sx 2022", "năm sản xuất 2022", "năm ra mắt 2022", "năm: 2022", "năm 22", "11 năm bảo hành". A screen size (10 to 16) is never a warranty in years, so the year lookahead (and its unbounded "20243") is gone.Before/after keys
Over every string literal mentioning Watch/iPad/MacBook in apps/importer/src, packages, apps/web/e2e and supabase (562 strings, new fixtures included),
origin/devvs this branch: 7 changed, all fixtures of this issue:#1263 / #1277 / #1291 / #1317 fixtures unchanged ("MacBook Air M2 13 năm" stays size-less).
Checks
pnpm --filter @repo/crawlers test, typecheck, lint, prettier: green locally.🤖 Generated with Claude Code
📌 TL;DR
Refines the Shopee product normalizer's size extraction logic to correctly handle Vietnamese "year" tokens (e.g., "năm 2022") and bare size matches, preventing false positives where production years or duplicate gift sizes are misidentified as device dimensions.
🎯 Type of Change
🔍 Changes Walkthrough
apps/importer/src/shopee/__tests__/open-core-intelligence.test.tsapps/importer/src/shopee/product-normalizer.tsSIZE_NOT_FOLLOWED_BYregex to exclude "năm" (year) from being treated as a size suffix unless followed by specific delimiters.2. Refactors
readAppleSizeto introduce anamesOtherBarehelper. This ensures that if a bare size is found in the product title, it is only considered valid if it differs from the gift's size, preventing the gift's size from overriding the product's actual size when they match.📊 Architectural Flow
flowchart TD A[Raw Product Title] --> B[Extract Gift Sizes] B --> C{Gift Size Count == 1?} C -->|No| D[Return Empty / Default] C -->|Yes| E[Identify Gift Size] E --> F[Scan Product Part for Sizes] F --> G{Found Bare Size?} G -->|No| H[Check Standard Patterns] G -->|Yes| I{Bare Size != Gift Size?} I -->|No| J[Ignore Bare Size] I -->|Yes| K[Accept Bare Size] H --> L[Validate Against Regex Rules] L --> M{Is 'nam' followed by year/delimiter?} M -->|Yes| N[Exclude from Size Match] M -->|No| O[Include in Size Match] J --> P[Final Size Resolution] K --> P N --> P O --> P P --> Q[Normalized Product Object]