Skip to content

Android TV sign-in keeps polling forever when the server can't be reached #420

Description

@Quick104

If the server can't be reached, or keeps answering with an error other than 404, while the Android TV shows its sign-in QR code, the TV polls forever. The screen keeps showing the QR code and "Waiting for approval…" long after the code has expired. It shows no countdown, so nothing tells the user the code or the server is the problem.

Why

  • DeviceLoginRepository.runPollLoop is a while (true) loop. Both ApiResult.Error (other than 404) and ApiResult.NetworkError wait one interval and try again, with no deadline from expires_in and no backoff (DeviceLoginRepository.kt).
  • When the user leaves the screen, TvLoginViewModel.onCleared cancels its jobs (TvLoginViewModel.kt). It doesn't cancel the request on the server, which stays approvable until it expires.

Expected

  • Stop polling at the code's expires_at, then get a new code or show that it expired with "Try again".
  • Back off on network errors, 5xx and 429. When failures persist, show that the server can't be reached, with "Try again" and "Change server".
  • Cancel the request on the server when the TV abandons it, once Let a TV cancel its pending device sign-in silo-server#1682 lands.

Notes

AI disclosure

  • Harness: T3 Code (Claude Code agent harness)
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: AI-drafted at the maintainer's request, from reading the code on main at c38fb93; not reproduced on a device
  • Adversarial review: n/a

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions