Skip to content

Refactor/extension scoring#77

Merged
aCaboose merged 3 commits into
mainfrom
REFACTOR/Extension_Scoring
Mar 10, 2026
Merged

Refactor/extension scoring#77
aCaboose merged 3 commits into
mainfrom
REFACTOR/Extension_Scoring

Conversation

@21tmccauley

Copy link
Copy Markdown
Owner

This PR improves extension scan performance and simplifies the popup/background flow. The background now uses a single request/response for getCurrentTab (return true + sendResponse) instead of the previous two-message pattern, so the popup no longer hits 15s/10s timeouts or races when the service worker wakes. Both scanUrl and getCurrentTab call sendResponse as soon as getCachedOrScan resolves, then run icon/recent-scans/notifications in a fire-and-forget block so the popup is unblocked immediately. Scan requests use an AbortController with a 10s timeout so a slow server doesn’t hang the extension. HomeTab is simplified to one sendMessage plus a 12s timeout (no requestId, listener, or retry).

A new Jest suite in Extension/tests/scan.test.js covers performSecurityScan (success, URL normalization, aggregatedScore fallback, timeout/abort, network error) and getCachedOrScan (cache hit/miss/expired, in-flight deduplication), with fetch and chrome.storage mocked. CI now runs Extension unit tests on every push/PR. HomeTab logs a single end-to-end metric in the popup console: [NetSTAR][timing] popup: getCurrentTab end-to-end X ms. Extension and Server test suites pass; manual checks (cold start, manual scan, cache hit, timeout) should show faster response and no long freezes.

…ciency. Ensure requestId is mandatory for responses and streamline response structure. Enhance error handling for better debugging.
…endencies. Introduce a Bill of Materials document detailing project components and dependencies. Add unit tests for the Extension's scan functionality, improving test coverage and reliability. Update constants and message handling for better performance and error management.
@aCaboose
aCaboose merged commit 0c7a1ea into main Mar 10, 2026
1 check passed
@aCaboose
aCaboose deleted the REFACTOR/Extension_Scoring branch March 10, 2026 15:09
@aCaboose

Copy link
Copy Markdown
Collaborator

Only thing of note so far was long load times, which could be caused by some API's being down with NetStar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants