Skip to content

Fix empty host selection state#47

Open
kopertop wants to merge 1 commit into
dodo-reach:mainfrom
kopertop:fix-empty-host-selection
Open

Fix empty host selection state#47
kopertop wants to merge 1 commit into
dodo-reach:mainfrom
kopertop:fix-empty-host-selection

Conversation

@kopertop
Copy link
Copy Markdown

@kopertop kopertop commented Jun 1, 2026

Summary

Fixes an empty-state bug where saving a host persists it locally but leaves Hermes Desktop without an active host selection.

Root Cause

AppState.saveConnection(_:) saved the profile but did not promote it to activeConnectionID or persist it as lastConnectionID when the app had no active host.

On launch, AppState also trusted lastConnectionID directly, so a missing or stale preference could strand valid saved hosts in connections.json.

Changes

  • Select and persist the saved host when saving from a no-active-host state.
  • Recover at startup from missing or stale lastConnectionID by selecting the most recently connected/updated saved host.
  • Add regression tests for first-host save, adding additional hosts without switching, missing last-connection preference, and stale last-connection preference.
  • Add localization for the new host-saved status message.

Validation

  • ./scripts/run-tests.sh passed with 116 tests.

Co-authored by Codex

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