Background
The official SDK handles a scaned_but_redirect status during QR code login polling. After the user scans the QR code, the server may respond with this status and a redirect_host field, indicating the client should continue polling at a different IDC endpoint.
Current behavior
QR login loop handles: confirmed, scaned, expired, and falls through to "keep polling" for unknown statuses. No special handling for scaned_but_redirect.
Investigation needed
- Does the live API actually return
scaned_but_redirect? (May depend on geographic location / IDC routing)
- What is the format of
redirect_host? Full URL or hostname only?
- How often does this occur in practice?
Phase 1 (logging)
Add DEBUG logging for all poll_qr_status responses to capture any occurrence of this status.
Phase 2 (implementation, after investigation confirms the behavior)
- Add
scaned_but_redirect branch in QR login loop
- Extract
redirect_host and switch subsequent polls to that host
- Update admin panel's
_handle_poll_login similarly
Files
src/weilink/client.py
src/weilink/admin/handlers.py
Background
The official SDK handles a
scaned_but_redirectstatus during QR code login polling. After the user scans the QR code, the server may respond with this status and aredirect_hostfield, indicating the client should continue polling at a different IDC endpoint.Current behavior
QR login loop handles:
confirmed,scaned,expired, and falls through to "keep polling" for unknown statuses. No special handling forscaned_but_redirect.Investigation needed
scaned_but_redirect? (May depend on geographic location / IDC routing)redirect_host? Full URL or hostname only?Phase 1 (logging)
Add DEBUG logging for all
poll_qr_statusresponses to capture any occurrence of this status.Phase 2 (implementation, after investigation confirms the behavior)
scaned_but_redirectbranch in QR login loopredirect_hostand switch subsequent polls to that host_handle_poll_loginsimilarlyFiles
src/weilink/client.pysrc/weilink/admin/handlers.py