Skip to content

fix: startup reliability, ConnectOnLaunch wiring, and reconnect UX#3

Merged
ethanndickson merged 1 commit intomainfrom
startup-0ttz
Mar 5, 2026
Merged

fix: startup reliability, ConnectOnLaunch wiring, and reconnect UX#3
ethanndickson merged 1 commit intomainfrom
startup-0ttz

Conversation

@ethanndickson
Copy link
Member

What changed

  • Add bounded startup RPC reconnect retry during app initialization (5 attempts with delays: 0s, 1s, 2s, 4s, 8s) to handle service/socket boot races.
  • Wire CoderConnectSettings.ConnectOnLaunch into startup flow and auto-start VPN when prerequisites are met:
    • reconnect succeeded
    • credentials are valid
    • RPC lifecycle is connected
    • VPN lifecycle is stopped
  • Fix disconnected page reconnect button logic so it is enabled while disconnected.
  • Disable reconnect button immediately when reconnect is initiated, and re-enable it on failure.
  • Fix RpcController.SpeakerOnError fire-and-forget reconnect path to correctly run reconnect asynchronously with warning logs on failure.
  • Update settings copy from Windows-specific wording to platform-neutral wording.

Why

This addresses startup reliability and UX regressions where:

  1. App could land in disconnected state due to boot timing and never recover automatically.
  2. Reconnect button was disabled in disconnected state.
  3. "Connect on launch" setting was persisted/displayed but not actually used.

Validation

  • dotnet restore Coder.Desktop.sln
  • dotnet build Coder.Desktop.sln -c Release --no-restore
  • dotnet test Tests.CoderSdk/Tests.CoderSdk.csproj --no-restore -v q
  • dotnet test Tests.Vpn.Proto/Tests.Vpn.Proto.csproj --no-restore -v q
  • dotnet test Tests.Vpn/Tests.Vpn.csproj --no-restore -v q
  • dotnet test Tests.Vpn.Service/Tests.Vpn.Service.csproj --no-restore -v q

All listed tests passed.

Risk / rollback

  • Changes are scoped to startup orchestration, reconnect button state handling, and error-path reconnect logic.
  • Rollback path: revert commit cc1dcef.

- Add bounded startup retry (5 attempts with exponential backoff) for
  RPC reconnect to handle boot race when VPN service socket isn't ready
- Wire ConnectOnLaunch setting into startup so VPN auto-starts when
  setting is enabled and all prerequisites are met
- Fix inverted reconnect button logic: enable in Disconnected state
  (when user needs it), disable during Connecting
- Fix SpeakerOnError fire-and-forget: properly await Reconnect via
  Task.Run instead of using var on a Task (which is a no-op Dispose)
- Fix settings page copy: 'Windows startup' -> 'when you sign in'
@ethanndickson
Copy link
Member Author

Gonna test this for a few days and merge if it works

@ethanndickson
Copy link
Member Author

Works well!

@ethanndickson ethanndickson added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit fb8e9fd Mar 5, 2026
1 check passed
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