Repository navigation
fix(web): extension verdict, cheaper-elsewhere and inspect skip sold-out offers - #1180
Conversation
- evaluateExtensionPriceVerdict drops out_of_stock and discontinued offers before the market reference, the cheaper-offer count and the implausibly-low check, for the extension lookup and the inspect API. - lookupExtensionProduct's cheaper-elsewhere list and its fallback match use in-stock offers only; a URL-matched listing is still judged. - inspectProductOrShopUrl's fallback match skips sold-out listings too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…old-out own page 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 56 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 |
Follow-up from #1170 / #1176: the browser extension and the inspect surfaces no longer cite sold-out or discontinued listings as the market reference, as cheaper options, or as a fallback match.
Changes
evaluateExtensionPriceVerdict(extension.ts) dropsout_of_stock/discontinuedoffers before computing:This covers both the extension lookup and
GET /api/v1/rate/inspect. The observed price is still judged when its own listing is sold out.lookupExtensionProduct: the "cheaper elsewhere" list and the no-URL-match fallback use in-stock offers only. A URL-matched listing is still the matched offer, whatever its availability.inspectProductOrShopUrl(rate-api.ts): neither fallback match picks a sold-out listing.Deep Inspect page: the client-side fallback match does the same filter, so a
nullserver match no longer brings back a sold-outallOffers[0].Unchanged on purpose:
allOffersin full mode, the price history and the radar input still receive every offer. They are for display and history, and the radar has filtered by availability since fix(web): batch offers read availability; radar and best offer skip sold-out listings #1176.Trade-off
Bait detection (
plausibleOffers/isImplausiblyLowPrice, #797) now runs on in-stock offers only, the same convention as #1176 and the storedmin_price(#1141). On a thin market the outlier check needs a minimum number of offers. So when a sold-out listing was the third offer, a bait price among the remaining two is no longer flagged.Tests
core-rate-architecture.test.ts. On Buds3 Pro-shaped data it checks:lookupExtensionProductshows only the in-stock cheaper store, and falls back to the cheapest in-stock offer.pnpm --filter @repo/web test,tsc --noEmitand eslint on the changed files are green.Closes #1177
🤖 Generated with Claude Code
📌 TL;DR
This PR updates the pricing and inspection logic to exclude sold-out and discontinued listings from market reference calculations, "cheaper elsewhere" comparisons, and fallback offer matching. This ensures that users are not shown unavailable products as valid price benchmarks or purchase options.
🎯 Type of Change
🔍 Changes Walkthrough
apps/web/src/components/inspect/DeepInspectWorkspace.tsxmatchedOfferto filter out unavailable offers usingisOfferUnavailablebefore selecting the first plausible offer.apps/web/src/lib/rate-api.tsinspectProductOrShopUrlto filter out unavailable offers when determining thematchedOfferand the final fallback return value, ensuring sold-out items are not selected.apps/web/src/server/rate/extension.tsevaluateExtensionPriceVerdictto filtersafeOffersto exclude unavailable items, preventing them from influencing market min/max prices.2. Updated
lookupExtensionProductto create aninStockOfferslist used for both fallback matching and market reference calculations (marketOffers).apps/web/src/server/rate/__tests__/core-rate-architecture.test.ts📊 Architectural Flow
flowchart TD A[Incoming Offers List] --> B{Filter: isOfferUnavailable?} B -->|Yes| C[Exclude from Market/Fallback] B -->|No| D[In-Stock Offers] D --> E[Calculate Market Min/Max] D --> F[Identify Cheaper Elsewhere] D --> G[Fallback Match Selection] C --> H[Retained for URL Match Only] H --> I[If User is on Sold-out Page] I --> J[Judge against In-Stock Market] E --> K[Price Verdict] F --> K G --> L[Matched Offer Result] J --> K