Skip to content

Stop QR browser polling after the QR host stops #35

Description

@cubrift

Problem

The QR page created in runtime/QRHost.js starts a setInterval(fetchQr, 1000) and never stops it. After Quart authenticates and closes the QR server, an already-open browser tab continues attempting requests indefinitely and logs repeated fetch errors.

Expected behavior

The QR page should stop polling when the QR session is no longer available or when repeated requests show that the server has gone away.

Suggested direction

Keep a reference to the interval, stop polling after a clear terminal response or a bounded number of consecutive failures, and show a small message telling the user that the QR session ended.

Acceptance criteria

  • Polling stops after the QR session ends.
  • A temporary request failure does not immediately break the page.
  • Repeated failures do not create an endless stream of requests or console errors.
  • The page tells the user that they can close or refresh it for a new QR code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    codexUse for codex-generated issues only.enhancementPerformance update or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions