Skip to content

SPA: poll for extension installation mid-session (don't require reload) #17

@hoainho

Description

@hoainho

Problem

C6 finding from PR #13 review: if user opens /measure (no extension), installs extension in another tab, then comes back to /measure tab without reload, the page is permanently stuck at NoBackendGuide. The instruction step 5 says 'Reload this page' but users who don't read it are confused.

Proposal

Add light polling fallback. While backend.kind === 'none' AND document.visibilityState === 'visible', re-run detectExtensionOnly() every 5 seconds. Stop polling on first hit OR after 60 seconds.

Cost: ~2KB code. Network: extension ping is in-process (no network).

Scope

  • apps/website/app/measure/page.tsx: add second useEffect for poll
  • Pause when document.visibilityState !== 'visible' to avoid wasted cycles in background tabs

Risk: LOW. Additive; doesn't change existing fast-path.

Acceptance: install extension → switch back to /measure → within 5s sees 'Extension Ready' badge without reload.

Source: Session 2026-05-22 weakness analysis A4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions