Skip to content

fix: report expired Weixin sessions#12223

Open
corazzione wants to merge 1 commit into
NousResearch:mainfrom
corazzione:fix-weixin-session-expiry-reporting
Open

fix: report expired Weixin sessions#12223
corazzione wants to merge 1 commit into
NousResearch:mainfrom
corazzione:fix-weixin-session-expiry-reporting

Conversation

@corazzione

Copy link
Copy Markdown
Contributor

Summary

  • Stop pausing the Weixin polling loop for 10 minutes when iLink reports an expired session.
  • Surface the expired-session state through the adapter fatal-error path so the gateway can report that QR login is required.
  • Add regression coverage for the expired-session polling response.

Root cause

The Weixin poll loop handled iLink session expiration by sleeping for 10 minutes and then retrying the same expired credentials. That kept the adapter in a connected-looking state without making progress or clearly reporting the required re-authentication step.

Changes

  • Convert iLink -14 responses from getUpdates into a non-retryable weixin_session_expired fatal error.
  • Notify the gateway fatal-error handler immediately instead of sleeping in the poll loop.
  • Cover the behavior with a poll-loop test that ensures no long pause is scheduled.

Validation

  • .\venv\Scripts\python.exe -m pytest tests\gateway\test_weixin.py::TestWeixinPollLoop::test_session_expiry_reports_fatal_error_without_long_pause -q -n0
  • .\venv\Scripts\python.exe -m pytest tests\gateway\test_weixin.py -q -n0
  • .\venv\Scripts\python.exe -m py_compile gateway\platforms\weixin.py tests\gateway\test_weixin.py
  • git diff --check

Fixes #12154

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/wecom WeCom / WeChat Work adapter labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/wecom WeCom / WeChat Work adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WeChat] asyncio.timeout bug and session expiration not handled gracefully

2 participants