-
Notifications
You must be signed in to change notification settings - Fork 2
Investigate delayed message delivery (possible ctx_token race) #2
Copy link
Copy link
Open
Description
Description
During testing via WeiLink MCP tools (Claude Code to WeChat), message delivery was occasionally delayed -- a reply would not appear on the user phone immediately, then suddenly pop up later.
Possible Cause
When multiple messages are exchanged rapidly, a ctx_token race condition may occur:
- Bot sends a reply using an older ctx_token
- User sends a new message concurrently, which updates the ctx_token on the server side
- The bot outgoing message arrives with a stale ctx_token
However, the message does eventually get delivered, suggesting the iLink server is tolerant of slightly stale tokens.
Current Behavior
- Messages are eventually delivered (not lost)
- Delay is intermittent and may also be caused by WeChat push notification latency
- The issue only manifests in multi-turn rapid conversation scenarios
Steps to Reproduce
- Start MCP server: weilink mcp -t http -p 45678
- Use an MCP client to rapidly recv, send, recv, send
- Observe occasional delivery delays on the WeChat side
Priority
Low -- no data loss observed. Monitor for recurrence before investing in a fix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels