Fix inactive products triggering backend requests and improve validation #1

Merged
starkSV merged 1 commit from fix-inactive-product-requests-6753598370478744190 into main 2026-05-12 18:30:03 +05:30
starkSV commented 2026-05-12 15:17:52 +05:30 (Migrated from github.com)

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

  • Improvements
    • Product detail pages now display clearer loading states with improved status messaging during product catalog retrieval
    • Enhanced validation with faster error detection and handling for unavailable or invalid products
    • Optimized data loading sequence for better user experience and faster issue identification

Review Change Stack

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](https://jules.google.com/task/6753598370478744190) started by @starkSV* <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Product detail pages now display clearer loading states with improved status messaging during product catalog retrieval * Enhanced validation with faster error detection and handling for unavailable or invalid products * Optimized data loading sequence for better user experience and faster issue identification [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/starkSV/windows-iso-downloader/pull/1) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
cloudflare-workers-and-pages[bot] commented 2026-05-12 15:17:53 +05:30 (Migrated from github.com)

Deploying msdl-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: fc60a9f
Status:   Deploy successful!
Preview URL: https://c99d8d65.msdl-frontend.pages.dev
Branch Preview URL: https://fix-inactive-product-request.msdl-frontend.pages.dev

View logs

## Deploying msdl-frontend with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages <table><tr><td><strong>Latest commit:</strong> </td><td> <code>fc60a9f</code> </td></tr> <tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr> <tr><td><strong>Preview URL:</strong></td><td> <a href='https://c99d8d65.msdl-frontend.pages.dev'>https://c99d8d65.msdl-frontend.pages.dev</a> </td></tr> <tr><td><strong>Branch Preview URL:</strong></td><td> <a href='https://fix-inactive-product-request.msdl-frontend.pages.dev'>https://fix-inactive-product-request.msdl-frontend.pages.dev</a> </td></tr> </table> [View logs](https://dash.cloudflare.com/?to=/630cc520524402c8c1de35025c15b122/pages/view/msdl-frontend/c99d8d65-3dcd-4819-89dc-0e217c25a4f7)
google-labs-jules[bot] commented 2026-05-12 15:17:53 +05:30 (Migrated from github.com)

👋 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.

👋 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](https://jules.google.com/settings). You can always switch back! New to Jules? Learn more at [jules.google/docs](https://jules.google/docs). --- *_For security, I will only act on instructions from the user who triggered this task._*
coderabbitai[bot] commented 2026-05-12 15:21:44 +05:30 (Migrated from github.com)
📝 Walkthrough

Walkthrough

ProductDetailPage refactors its product-loading flow to initialize catalog metadata with meta.active as false, validate the productId numerically 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

Layer / File(s) Summary
Catalog state initialization and validation
frontend/src/pages/ProductDetailPage.tsx
meta.active initializes to false, and during catalog load the effect resets state, validates productId as numeric, and sets isNotFound/productName early for invalid IDs.
Product metadata computation and downstream gating
frontend/src/pages/ProductDetailPage.tsx
On catalog fetch success, isActive is derived from product.active, meta is updated with that flag, related labels are populated, and isValidated is set only for active products to prevent downstream language-fetch for discontinued entries.
Catalog loading UI state
frontend/src/pages/ProductDetailPage.tsx
A new render branch displays "Loading catalog..." while the catalog is being fetched (when productName is not yet set and the page is neither not-found nor in catalog-error), before existing error/discontinued/language-loading branches.
ProductsPage filter cleanup
frontend/src/pages/ProductsPage.tsx
Filter callback destructuring is updated to omit the unused entry key variable while preserving the active status filter logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The catalog now loads with purpose clear,
A false flag guards what's inactive here.
Early checks prevent the broken path,
While only live products feel the system's wrath.
Filters simplified with care so neat—
A rabbit's refactor, tidy and sweet!

🚥 Pre-merge checks | 4 | 1

Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly reflects the main changes in the pull request, which focus on preventing inactive products from triggering backend requests and improving validation logic throughout the product detail page.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-inactive-product-requests-6753598370478744190

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough ProductDetailPage refactors its product-loading flow to initialize catalog metadata with `meta.active` as `false`, validate the `productId` numerically 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** | Layer / File(s) | Summary | | --- | --- | | **Catalog state initialization and validation** <br> `frontend/src/pages/ProductDetailPage.tsx` | `meta.active` initializes to `false`, and during catalog load the effect resets state, validates `productId` as numeric, and sets `isNotFound`/`productName` early for invalid IDs. | | **Product metadata computation and downstream gating** <br> `frontend/src/pages/ProductDetailPage.tsx` | On catalog fetch success, `isActive` is derived from `product.active`, `meta` is updated with that flag, `related` labels are populated, and `isValidated` is set only for active products to prevent downstream language-fetch for discontinued entries. | | **Catalog loading UI state** <br> `frontend/src/pages/ProductDetailPage.tsx` | A new render branch displays "Loading catalog..." while the catalog is being fetched (when `productName` is not yet set and the page is neither not-found nor in catalog-error), before existing error/discontinued/language-loading branches. | | **ProductsPage filter cleanup** <br> `frontend/src/pages/ProductsPage.tsx` | Filter callback destructuring is updated to omit the unused entry key variable while preserving the active status filter logic. | ## Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~20 minutes ## Poem > 🐰 The catalog now loads with purpose clear, > A false flag guards what's inactive here. > Early checks prevent the broken path, > While only live products feel the system's wrath. > Filters simplified with care so neat— > A rabbit's refactor, tidy and sweet! ✨ </details> <!-- walkthrough_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :----------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title clearly reflects the main changes in the pull request, which focus on preventing inactive products from triggering backend requests and improving validation logic throughout the product detail page. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> <sub>✏️ Tip: You can configure your own custom pre-merge checks in the settings.</sub> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing Touches</summary> <details> <summary>📝 Generate docstrings</summary> - [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> Create stacked PR - [ ] <!-- {"checkboxId": "3e1879ae-f29b-4d0d-8e06-d12b7ba33d98"} --> Commit on current branch </details> <details> <summary>🧪 Generate unit tests (beta)</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `fix-inactive-product-requests-6753598370478744190` </details> </details> <!-- finishing_touch_checkbox_end --> <!-- announcements_start --> > [!TIP] > <details> > <summary>💬 Introducing Slack Agent: The best way for teams to turn conversations into code.</summary> > > [Slack Agent](https://www.coderabbit.ai/agent) is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context. > > - Generate code and open pull requests > - Plan features and break down work > - Investigate incidents and troubleshoot customer tickets together > - Automate recurring tasks and respond to alerts with triggers > - Summarize progress and report instantly > > Built for teams: > > - **Shared memory** across your entire org—no repeating context > - **Per-thread sandboxes** to safely plan and execute work > - **Governance built-in**—scoped access, auditability, and budget controls > > One agent for your entire SDLC. Right inside Slack. > > 👉 [Get started](https://agent.coderabbit.ai/) > > </details> <!-- announcements_end --> <!-- tips_start --> --- <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end --> <!-- internal state start --> <!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKPR1AGxJcAYvAAeKBhoYpIkPBSK2GLIuBTwRKTxGESQAiEA1mT0FCQAjtjSuMiY9PDMvPhSkBJoHvC01PD4GAYAco4ClFwAjAYAqjYAMlywuLjciBwA9NNE6rDYAhpMzNOIuM4ZAMoAatMA7vAYtPgHiGBIhKcHGB74aEoU09zYHh7Tff2I3fabFDtdgZtvhsBQGOEBFQMAxYFwAGYBS7BUJSMCVWjRXBgXIFIoXABsAHYAKwAZhJAE4ABxkokABgALETqUTGYyepT6QZoM5SLg0tDYVxmNpWttNrhsFN+NwyAYAMK5ah0dCcSAAJnpGoJYHpJLAPQ10HplI4zI4JI1AC03AhkK93pBcYUNpBEf5pGkSLA0BJmnwDrBKOFjiFxNUMVjkMdILhg4xqHV8KkNvAnXEEklVesMthjvD8M78q7inGi/HIZlshpIArfSkvccGB5sEoOAYoFZcl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dSAIN9vqPCJSCSPCMyCWmSJSLtfhgwPFnFgSJSD0LQIyEyGgESAIAwJSIRgSKjh2bVODKtTYGaYCbhsdZ7h9WjvCGyNSFaFdVqCSFOpSIyAIAyD0GgVWiDfSMAUSD0HhFdWgHFkaEyJ7mSAwGSD0D0ByN9QUm0XgVQb3LQZQAwRaa/hQW6lQSaj8pXDciwSqBLQomwVDSCeVDcrQJuLgOCSqmQUIQQaCbLLgHmvSBze6iLWLT8BLTQD8oLXoEAA= --> <!-- internal state end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2026-05-12 15:23:58 +05:30
coderabbitai[bot] (Migrated from github.com) left a comment
🧹 Nitpick comments (1)
frontend/src/pages/ProductDetailPage.tsx (1)

129-150: 💤 Low value

Redundant guard condition and dependency.

Since isValidated is only set to true when the product is active (lines 106-108), checking !meta.active is redundant—isValidated being true already implies meta.active is true. Similarly, meta.active in the dependency array is unnecessary.

Not incorrect, but adds cognitive overhead for maintainers.

♻️ Suggested simplification
-    if (!productId || !isValidated || !meta.active) return
+    if (!productId || !isValidated) return
-  }, [productId, isValidated, meta.active])
+  }, [productId, isValidated])
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/pages/ProductDetailPage.tsx` around lines 129 - 150, Remove the
redundant check and dependency for meta.active: in the effect that early-returns
when (!productId || !isValidated || !meta.active) and has [productId,
isValidated, meta.active] as its dependency array, delete the meta.active
condition from the guard and remove meta.active from the dependency array so the
effect only gates and depends on productId and isValidated (refer to the fetch
block and setSelectedSku logic using productId, isValidated, meta.active).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@frontend/src/pages/ProductDetailPage.tsx`:
- Around line 129-150: Remove the redundant check and dependency for
meta.active: in the effect that early-returns when (!productId || !isValidated
|| !meta.active) and has [productId, isValidated, meta.active] as its dependency
array, delete the meta.active condition from the guard and remove meta.active
from the dependency array so the effect only gates and depends on productId and
isValidated (refer to the fetch block and setSelectedSku logic using productId,
isValidated, meta.active).

ℹ️ 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 79450e4b35 and fc60a9f37b.

📒 Files selected for processing (2)
  • frontend/src/pages/ProductDetailPage.tsx
  • frontend/src/pages/ProductsPage.tsx
<details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>frontend/src/pages/ProductDetailPage.tsx (1)</summary><blockquote> `129-150`: _💤 Low value_ **Redundant guard condition and dependency.** Since `isValidated` is only set to `true` when the product is active (lines 106-108), checking `!meta.active` is redundant—`isValidated` being true already implies `meta.active` is true. Similarly, `meta.active` in the dependency array is unnecessary. Not incorrect, but adds cognitive overhead for maintainers. <details> <summary>♻️ Suggested simplification</summary> ```diff - if (!productId || !isValidated || !meta.active) return + if (!productId || !isValidated) return ``` ```diff - }, [productId, isValidated, meta.active]) + }, [productId, isValidated]) ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/pages/ProductDetailPage.tsx` around lines 129 - 150, Remove the redundant check and dependency for meta.active: in the effect that early-returns when (!productId || !isValidated || !meta.active) and has [productId, isValidated, meta.active] as its dependency array, delete the meta.active condition from the guard and remove meta.active from the dependency array so the effect only gates and depends on productId and isValidated (refer to the fetch block and setSelectedSku logic using productId, isValidated, meta.active). ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary> ``` Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Nitpick comments: In `@frontend/src/pages/ProductDetailPage.tsx`: - Around line 129-150: Remove the redundant check and dependency for meta.active: in the effect that early-returns when (!productId || !isValidated || !meta.active) and has [productId, isValidated, meta.active] as its dependency array, delete the meta.active condition from the guard and remove meta.active from the dependency array so the effect only gates and depends on productId and isValidated (refer to the fetch block and setSelectedSku logic using productId, isValidated, meta.active). ``` </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: defaults **Review profile**: CHILL **Plan**: Pro Plus **Run ID**: `e316f65e-9595-49e5-9a8e-6013383adc02` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 79450e4b35b9bf2f232034acf06774628ec4ae90 and fc60a9f37b599c616bf3e34d8fca0f5445e52677. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `frontend/src/pages/ProductDetailPage.tsx` * `frontend/src/pages/ProductsPage.tsx` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: shekhar/windows-iso-downloader#1
No description provided.