Skip to content

fix(android): one session per reconnect, so the output is not written twice - #72

Merged
williamdes merged 3 commits into
android-appfrom
claude/android-reconnect-single-relay
Nov 16, 2026
Merged

williamdes merged 3 commits into
android-appfrom
claude/android-reconnect-single-relay

Conversation

@williamdes

Copy link
Copy Markdown
Member

Symptom

After a reconnect the terminal output repeated at different offsets. Ctrl+L hid it until more output arrived. Opening the reconnect menu again made it worse.

Cause

  • Reconnect queued the bridge on every press. While the network was down, each press added the bridge again. When the network returned, reconnectPending started the session once per queued entry, so one bridge opened several transports.
  • A replaced transport was never ended. startConnection swapped in a new transport without closing the old one. A tab-atelier session still redialling kept its relay reading into the same emulator, so the new relay wrote the same replay a second time.

Change

  • requestReconnect queues a bridge only once.
  • startConnection closes the tab-atelier transport it replaces. SSH is left alone because its close() defers during a network grace period.
  • Regression test reconnectingWhileOfflineStartsTheSessionOnce.

Not verified on a device

The unit test covers the queue; the relay behaviour needs a run against a real daemon.


Generated by Claude Code

… twice

Reconnect queued the bridge every time it was pressed while the network was down.
When the network came back, the bridge started its session once per press, and each
transport kept a relay writing into the same emulator at a different offset: the
output repeated in pieces, and clearing the screen hid it until the next output.

A reconnect now queues a bridge once. startConnection also ends the tab-atelier
transport it replaces, so a session still redialling cannot keep its relay reading.

Claude-Session: https://claude.ai/code/session_01G6dpqPucDGns6rELSQeSdr
… back

docs/upstream/ goes through the fork's changes under connectbot/, against the
upstream base e484bd3a and the current upstream HEAD 1798d07. Each group says
whether it can be offered upstream and how, and the index lists every changed
file with the number of upstream commits that touched it since the base.

The fork is not moved to the newer upstream here; that is a separate sync.

Claude-Session: https://claude.ai/code/session_01G6dpqPucDGns6rELSQeSdr
…s own NetworkInfo

The test mocked Android's NetworkInfo, but getCurrentNetworkInfo returns the
monitor's nested data class, so the unit test build failed to compile.

Claude-Session: https://claude.ai/code/session_01G6dpqPucDGns6rELSQeSdr
@williamdes
williamdes merged commit ff56013 into android-app Nov 16, 2026
1 check passed
@williamdes
williamdes deleted the claude/android-reconnect-single-relay branch November 16, 2026 13:09
@williamdes williamdes self-assigned this Nov 16, 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