Fix inactive products triggering backend requests and improve validation #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shekhar/windows-iso-downloader#1
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix-inactive-product-requests-6753598370478744190"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change addresses the issue where inactive products in the catalog still triggered /skuinfo requests to the backend. It also adds a regex validation for product IDs, ensures meta.active is initialized to false for a safer default, and implements a loading state while fetching the product catalog.
PR created automatically by Jules for task 6753598370478744190 started by @starkSV
Summary by CodeRabbit
Deploying msdl-frontend with
Cloudflare Pages
fc60a9fView logs
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.
When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.
I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!
For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with
@jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!New to Jules? Learn more at jules.google/docs.
For security, I will only act on instructions from the user who triggered this task.
📝 Walkthrough
Walkthrough
ProductDetailPage refactors its product-loading flow to initialize catalog metadata with
meta.activeasfalse, validate theproductIdnumerically early, derive an active status from the fetched product, and gate downstream language-fetching to only active products. ProductsPage removes an unused destructuring binding in its product-filter callback.Changes
Product Catalog Loading and Validation
frontend/src/pages/ProductDetailPage.tsxmeta.activeinitializes tofalse, and during catalog load the effect resets state, validatesproductIdas numeric, and setsisNotFound/productNameearly for invalid IDs.frontend/src/pages/ProductDetailPage.tsxisActiveis derived fromproduct.active,metais updated with that flag,relatedlabels are populated, andisValidatedis set only for active products to prevent downstream language-fetch for discontinued entries.frontend/src/pages/ProductDetailPage.tsxproductNameis not yet set and the page is neither not-found nor in catalog-error), before existing error/discontinued/language-loading branches.frontend/src/pages/ProductsPage.tsxEstimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
fix-inactive-product-requests-6753598370478744190Comment
@coderabbitai helpto get the list of available commands and usage tips.🧹 Nitpick comments (1)
🤖 Prompt for all review comments with AI agents
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
e316f65e-9595-49e5-9a8e-6013383adc02📥 Commits
Reviewing files that changed from the base of the PR and between
79450e4b35andfc60a9f37b.📒 Files selected for processing (2)
frontend/src/pages/ProductDetailPage.tsxfrontend/src/pages/ProductsPage.tsx