-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Summary
When the desktop app restarts and mobile reconnects via WsBridge, the first message sent from mobile may be lost if sessions are still restoring.
Repro
- Desktop is running with active sessions, mobile connected
- Relaunch desktop (
relaunch.sh) - Mobile auto-reconnects (bridge port retry fix from PR Fix mobile streaming throttle and stale IsProcessing state #449)
- Immediately send a message from mobile before tapping refresh
- Message is lost — server returns "Session is already processing a request"
Expected
Messages sent during restore should be queued and delivered once the session is ready.
Workaround
Tap the refresh/sync button on mobile after reconnect, then send the message. This forces a full state sync and the session becomes responsive.
Root Cause
The WsBridge server accepts client connections during restore but sessions aren't fully initialized yet. The client's send_prompt arrives before RestorePreviousSessionsAsync completes, hitting a session in a half-loaded state.
Possible Fix
Queue incoming send_prompt messages during the IsRestoring window and replay them once restore completes, similar to how sessions_list broadcast is deferred.