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.
Problem
The QR page created in
runtime/QRHost.jsstarts asetInterval(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