Skip to content

fix(android): stop a stale dial showing the wrong tab, and make the LAN fallback reachable - #71

Merged
williamdes merged 2 commits into
android-appfrom
claude/mobile-render-agent-fixes-3je33h-android
Nov 16, 2026
Merged

williamdes merged 2 commits into
android-appfrom
claude/mobile-render-agent-fixes-3je33h-android

Conversation

@williamdes

@williamdes williamdes commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Verified by CI: the new android-check workflow (unit tests and a debug build, no secrets, no publishing) passes on head b3852c2. The device behaviour is not checked: the tab-switch and LAN-fallback fixes need a run against a real daemon before the release workflow publishes them.

Returning to a session showed another tab's contents

Disconnecting cured it because that builds a fresh bridge, emulator and transport.

  • A dial that has been overtaken gives up. A dial blocks for up to 15 s per address and cannot be cancelled meanwhile, so a resume still dialling the tab being left could outlive a switch, reach its next address and take the session's socket back. Dials now carry a generation that a switch, a suspend and a close bump.
  • The replay is preceded by a mode reset. The erase cleared only the buffer that was showing, so a tab left inside a full-screen program showed through. The prefix now leaves the alternate screen and undoes scroll region, attributes, character set, mouse and paste modes first. Spelled out rather than ESC c, to avoid discarding the tab's background. How termlib handles each sequence was not verified on a device.
  • A frame decoded during a switch is dropped instead of being queued after the queue was cleared.
  • The transport does not reset on a connectivity change. ConnectBot's default closed a transport that was already redialling itself, leaving a bridge with no Relay.
  • A tab tapped on a session that is over reconnects on that tab, and a switch records its tab for the app's own reconnect.

The local-address fallback did not work

  • The local set is derived. TabAtelierAddresses.local defaulted to empty and neither construction site set it, so the LAN preference never applied to a real host. An established session can now also move back to a local address.
  • The tab list tries every address. It asked only the primary, so with an unreachable public name there were no tabs to tap. Only a failure to reach an address moves on; an HTTP answer stands.
  • An invalid fallback blocks the save instead of being dropped silently (a bare 192.168.1.10:8443, for example).
  • Cleartext http:// is permitted (usesCleartextTraffic). That it was blocked before is inferred from the manifest and target SDK, not observed.
  • A socket failing mid-walk only wakes the walk. It used to start a redial that raced the walk for the session's socket.

CI

  • .github/workflows/android-check.yml (new): runs on pull requests to android-app. Unit tests and a debug build via scripts/build-apk.sh --debug. No secrets, no signing with the release key, no publishing. android-apk.yml is unchanged and still the only release path.

Not included

A shorter connect timeout for non-last addresses, a CA-signed certificate served on a LAN IP, wider LAN detection (IPv6, 100.64/10), and inheriting the scheme for a bare fallback entry.

Tests

Added theLocalAddressesAreDerivedFromTheAddressesThemselves and theModesAreResetBeforeTheErase, and updated the erase test for the new prefix. The generation guard has no test: openSocketAt has no seam for a fake socket.


Generated by Claude Code

…AN fallback reachable

Returning to a session could show another tab's contents until it was
disconnected:

- a dial still in flight for the tab being left could outlive a switch and
  take the session's socket back; dials now carry a generation that a
  switch, a suspend and a close bump
- the erase before a replay left the emulator's modes alone, so a tab left
  in a full-screen program showed through; the modes are reset first
- a frame decoded during a switch could be queued after the queue was cleared
- the transport was closed by ConnectBot's network-change reset although it
  redials itself, and a later tab tap then only changed the title
- a switch did not record the tab for the app's own reconnect

The local-address fallback did not work for a server on the phone's network:

- the local set defaulted to empty, so the LAN preference never applied
- the tab list asked only the primary address
- an invalid fallback was dropped on save instead of blocking it
- cleartext http was refused by the platform
- a socket failing mid-walk started a redial that raced the walk

Not compiled or run: no Android SDK was available where this was written.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G6dpqPucDGns6rELSQeSdr
android-apk runs only on pushes to android-app and signs with the release key,
so a branch could not be verified before merging. This adds a pull-request check
with no secrets: the unit tests and a debug build, through the same script.

Claude-Session: https://claude.ai/code/session_01G6dpqPucDGns6rELSQeSdr
@williamdes
williamdes marked this pull request as ready for review November 16, 2026 08:27
@williamdes
williamdes merged commit ece318d into android-app Nov 16, 2026
1 check passed
@williamdes
williamdes deleted the claude/mobile-render-agent-fixes-3je33h-android branch November 16, 2026 08:44
@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