Skip to content

fix(client): resubscribe a connected shell stuck synchronizing - #908

Merged
trancong12102 merged 1 commit into
mainfrom
fix/shell-stall-resubscribe
Dec 1, 2026
Merged

trancong12102 merged 1 commit into
mainfrom
fix/shell-stall-resubscribe

Conversation

@trancong12102

Copy link
Copy Markdown
Contributor

Problem

On mobile, with two paired environments, the thread list for one of them sometimes stayed on "Syncing threads…" and went stale. It recovered only after the app was foregrounded again. Server traces on both hosts show every subscription answered within milliseconds, with its completion marker. So the client sometimes never moved that environment's shell to live, and nothing retried while the connection stayed healthy. The exact client path is still unknown, and the app cannot report it.

Fix

  • EnvironmentShellState watches for a shell that stays synchronizing while its connection is connected. After 30 s it resubscribes, doubling the wait up to 4 min while it stays stuck. The supervisor still owns disconnected and connecting states.
  • Each stall logs a warning and reports environment_shell_stalled through a new ClientDiagnostics reference, which defaults to a no-op. The report holds only counts and flags: awaiting completion, held snapshot, subscription on the live session, verification pending or rejected. Desktop and mobile send it to Sentry as a warning, only when error reports are on. The next occurrence then shows which path dropped the marker.
  • A shell-sync test covers this: no resubscribe while connecting, a resubscribe plus a report once connected, then silence after the marker. It fails on main.

🤖 Generated with Claude Code

A connected environment's thread list could stay on "Syncing threads…" until
the app was next foregrounded. After 30 s connected and still synchronizing,
the shell now resubscribes (backing off to 4 min) and reports a
counts-and-flags diagnostic to Sentry on desktop and mobile, so the next
occurrence shows why it stalled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trancong12102
trancong12102 merged commit 3e8e63d into main Dec 1, 2026
20 checks passed
@trancong12102
trancong12102 deleted the fix/shell-stall-resubscribe branch December 1, 2026 17:28
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