Skip to content

Fix Chrome Web Store URL validation and partial report score handling #220

@SrashtiChauhan

Description

@SrashtiChauhan

Problem

There are two issues affecting the scan flow and results display:

1. Chrome Web Store URL validation fails for valid URLs

Valid Chrome Web Store URLs such as:

https://chromewebstore.google.com/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb

are sometimes rejected with:

Invalid Chrome Web Store URL format

This happens because:

  • The frontend uses a strict URL validator (isValidChromeUrl)
  • It does not fully support newer Chrome Web Store URL formats
  • It blocks execution before extractExtensionId() is used

2. Partial reports hide available scores (UI issue)

When a scan results in a partial report (e.g., due to missing backend components like LLM providers), the UI currently forces:

  • score = null
  • band = "NA"

even when valid scoring data exists in the response.

This leads to:

  • Misleading UI (shows N/A instead of actual scores)
  • Poor user experience
  • Inconsistent behavior with backend data

Expected Behavior

  • Valid Chrome Web Store URLs should always be accepted
  • Validation should rely on extractExtensionId() instead of strict URL checks
  • Partial reports should still display available scores
  • Only missing data should be marked as unavailable

Proposed Solution

Fix 1: Remove outdated URL validator

  • Remove or bypass isValidChromeUrl
  • Use extractExtensionId(input) as the single source of truth
const extensionId = realScanService.extractExtensionId(input);

if (!extensionId) {
  setError("Invalid Chrome Web Store URL");
  return;
}

Fix 2: Improve partial report score handling

Replace:

score={isPartialReport ? null : scores?.privacy?.score}
band={isPartialReport ? "NA" : scores?.privacy?.band || 'NA'}

With:

score={scores?.privacy?.score ?? null}
band={scores?.privacy?.band || 'NA'}

Apply the same logic to:

  • Security
  • Governance

Fix 3 (Optional UX Improvement)

Only show "no data" warning when no scores exist:

const hasAnyScore =
  scores?.security?.score ||
  scores?.privacy?.score ||
  scores?.governance?.score;

Impact

  • Fixes broken scan flow for valid Chrome Web Store URLs
  • Improves reliability of results page
  • Ensures UI reflects actual backend data
  • Enhances overall user experience

Additional Context

Tested locally with:

  • Valid Chrome Web Store URLs
  • Partial scan responses (missing LLM modules)

The fixes resolve both validation and display inconsistencies.


Request

If this approach looks good, I’d be happy to open a PR implementing these fixes.

Metadata

Metadata

Labels

bugBug report or bug fix related workfeatureFeature request or feature implementationsecuritySecurity-sensitive issue or change

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions