You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up of #1092 (the regex that #1092 introduced). Raised from DOS/Rate-Services#646 after Rate-Services#644 bumped vendor/rate to 8d0f960f. Both defects are in packages/shared-data/src/rules/listing-price-floor.ts (EARBUDS_TITLE_REGEX), reproduced against that exact commit. No production effect seen so far.
1. Glued tiers miss the regex (earbuds get the 1.2M device floor)
minimumListingPriceVnd([title]) returns 1_200_000 instead of 400_000 for:
Title
Why it misses
Samsung Galaxy BudsPro3
a number follows the tier (buds + pro + 3), so the trailing \b fails
Huawei FreeBudsPro4
same, after freebuds
SamsungGalaxyBuds3
Buds is glued to Galaxy, so the leading \b fails
Effect: a real earbuds listing of 400k-1.2M VND is rejected as an accessory when the caller has no earbuds target key (Rate-Services discovery passes target keys, which do match, so masters keep their hits today).
2. wh- makes over-ear headphones take the earbuds floor
Sony WH-1000XM5 and Sony WH-CH720N are over-ear headphones, not earbuds, yet both match wh- and get 400_000. A 450k listing of a 6M headphone is then not rejected by price. Rate-Services only has the median guard (DISCOVERY_MIN_MARKET_PRICE_RATIO) as a backstop, and that needs a master median.
(tws, earpods, soundpeats, in-ear are also new in the wider regex and are legitimately earbuds, so keep them.)
Proposed change
Drop wh-, allow digits after a tier, accept galaxybuds glued to a brand word, allow pro/se after freebuds:
Earbuds (400_000): Samsung Galaxy BudsPro3, Samsung Galaxy Buds Pro 3, Huawei FreeBudsPro4, Huawei FreeBuds5i, Huawei FreeBuds 5i, SamsungGalaxyBuds3, Galaxy Buds3 Pro, Galaxy Buds2Pro, Sony WF-1000XM5, Apple AirPods Pro 2, AirPodsPro.
Device (1_200_000): Sony WH-1000XM5, Sony WH-CH720N, Samsung Galaxy S24, Galaxy Watch7, Samsung Galaxy Z Flip, Buddha statue.
All 17 pass with the proposed regex (checked with a standalone node script); the current regex fails the first three earbuds rows of item 1 plus the two WH- rows.
Acceptance
Add the cases above to the listing-price-floor unit test.
Bump vendor/rate in Rate-Services afterwards (no Rate-Services code change needed, it imports the shared regex).
[Agent: Core] Claiming this. I will verify the proposed regex against the 17 cases and the existing tests, then open a PR into dev that lists the Rate-Services pins it could affect.
Activity
JOY commentedon Oct 27, 2026
[Agent: Core] Claiming this. I will verify the proposed regex against the 17 cases and the existing tests, then open a PR into
devthat lists the Rate-Services pins it could affect.test(shared-data): pin model-key forms for the earbuds floor (#1116)
fix(shared-data): keep the earbuds regex free of polynomial backtrack…
fix(shared-data): earbuds regex reads glued tiers and drops over-ear …
JOY commentedon Oct 27, 2026
[Agent: PO] Released to production in #1128 (main c23ab85). verify-live: https://rate.vn serves main c23ab85, database ok, 5 routes 200.