Skip to content

fix(launch): wait for connected state before auto-launching browser#1102

Merged
JamieRuderman merged 2 commits into
mainfrom
fix/auto-launch-after-connected
Jun 1, 2026
Merged

fix(launch): wait for connected state before auto-launching browser#1102
JamieRuderman merged 2 commits into
mainfrom
fix/auto-launch-after-connected

Conversation

@JamieRuderman
Copy link
Copy Markdown
Member

Summary

  • Auto-launch on connect was firing as soon as the local listener bound (ready), but before the tunnel actually finished establishing (connected). This caused the browser to open against a port that wasn't yet routing traffic.
  • Now gates auto-launch on ready && connected for local/proxy connections. ConnectLink (persistent shared URL) connections are unaffected — they still launch immediately, as they have no connecting lifecycle.

Root cause

In LaunchButton.tsx, the ready flag was:

const ready = connection?.connectLink || connection?.ready

For a local connection, the lifecycle is:

  1. connect() immediately sets ui.autoLaunch = connection.id (connections.ts:445)
  2. Backend binds the local port → connection.ready = true
  3. LaunchButton sees autoLaunch && ready → opens browser ❌ (too early)
  4. Cloud DEVICE_CONNECT event arrives → connection.connected = true (cloudController.ts:429)

Proxy connections set ready, connecting: false, and connected: true atomically (connections.ts:333-335), so requiring connected doesn't regress them.

Test plan

  • Connect to a local (P2P) remote.it service with auto-launch enabled — browser should open only after the connection reports "Connected", not while still "Connecting"
  • Connect via proxy connection with auto-launch enabled — browser should still open as expected
  • Open a ConnectLink with auto-launch — should still launch immediately
  • Verify the launch button's loading spinner now stays spinning through the full connecting → connected transition

@aws-amplify-us-west-1
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1102.d20k671nqqv4kl.amplifyapp.com

1 similar comment
@aws-amplify-us-west-1
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1102.d20k671nqqv4kl.amplifyapp.com

@JamieRuderman JamieRuderman merged commit bc45000 into main Jun 1, 2026
8 checks passed
@JamieRuderman JamieRuderman deleted the fix/auto-launch-after-connected branch June 1, 2026 22:47
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