Skip to content

fix(weixin): single-source QR login and non-blocking Settings refresh#406

Open
Gucc111 wants to merge 2 commits into
OpenBMB:mainfrom
Gucc111:weixin-qr-login-fix
Open

fix(weixin): single-source QR login and non-blocking Settings refresh#406
Gucc111 wants to merge 2 commits into
OpenBMB:mainfrom
Gucc111:weixin-qr-login-fix

Conversation

@Gucc111

@Gucc111 Gucc111 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make WeixinChannel the single source of QR login — the UI server no longer calls weixin-ilink.loginWithQR() directly, eliminating the dual-login race condition.
  • Add prepare_weixin_login gateway RPC so the Settings page can trigger a backend channel start/restart without importing weixin-ilink.
  • Fix Settings auto-refresh unmounting the QR code: useGatewayStatus now does silent refresh (no full-page loading spinner) once initial data is loaded.
  • Write qrUrl into runtime-status.json from WeixinChannel.onQRCode, so the UI reads the QR code from runtime state instead of maintaining its own login task.
  • Use requestedAt timestamp to ignore stale failed/expired runtime errors from previous attempts.

Test plan

  • npm test — 58 tests pass (includes new regression tests for begin route, runtime QR persistence, stale error filtering, and protocol RPC exposure)
  • npm --workspace ui run build — succeeds
  • Manual: start PilotDeck with adapters.weixin.enabled: false, click WeChat QR login in Settings → should show "preparing" then display QR code
  • Manual: with an old failed runtime state, click QR login again → should restart the channel, not show the stale error
  • Manual: QR code stays visible during 3-second auto-refresh cycles (no unmount/remount)

Made with Cursor

Gucc111 and others added 2 commits July 13, 2026 18:45
Start the gateway before IM channel initialization and surface Weixin QR login state so Web UI remains usable while channels connect.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant