Skip to content

fix(feishu): stabilize legacy WebSocket client loop lifecycle#288

Merged
duguwanglong merged 2 commits into
devfrom
fix/feishu-ws-compat-loop-shutdown
May 19, 2026
Merged

fix(feishu): stabilize legacy WebSocket client loop lifecycle#288
duguwanglong merged 2 commits into
devfrom
fix/feishu-ws-compat-loop-shutdown

Conversation

@xiami762
Copy link
Copy Markdown
Contributor

@xiami762 xiami762 commented May 19, 2026

Summary

  • Initialize legacy lark_oapi WebSocket client on the worker thread's event loop to avoid "attached to a different loop" errors.
  • Improve shutdown: track ping/receive tasks, reset state on stop, and guard coroutine scheduling when the loop is not running.
  • Handle early stop() during slow client initialization: wait for init, skip start() when stop is requested, and avoid scheduling on a stopped loop.

xiami762 and others added 2 commits May 19, 2026 15:07
Defer lark_oapi Client construction to the background thread's event loop
to avoid "attached to a different loop" errors. Track ping/receive tasks
and reset state on stop so restart is reliable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wait for worker-thread client init before stop proceeds; skip start when
stop is requested early. Guard coroutine scheduling when loop is not running.

Co-authored-by: Cursor <cursoragent@cursor.com>
@duguwanglong duguwanglong merged commit b6159a3 into dev May 19, 2026
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.

2 participants