Skip to content

Commit 711956b

Browse files
fcouryrekurt
andauthored
fix(tui): defer startup reconnect and add manager actions (#38)
* fix(tui): defer startup reconnect and add manager actions Defer saved-connection password resolution until after the first TUI frame and add safe mode flags for bypassing startup reconnect and update-check side effects. Add connection manager actions for copying sanitized URLs, copying `tsql` commands, and testing saved connections while preserving the existing duplicate flow on a distinct key. Co-authored-by: nikita42 <13642481+rekurt@users.noreply.github.com> * fix(tui): ignore stale saved connection resolves Track saved-connection password lookups with a generation token so late credential results cannot override a newer connect or disconnect. Copy `tsql <connection-name>` commands from the connection manager so startup keeps using saved entry credential resolution. * fix(tui): honor safe mode before startup connects Clear config `connection.default_url` before building the app in safe mode so startup cannot auto-connect from configuration. Emit and parse `--` for saved connection names that look like options so copied CLI commands still resolve the selected saved entry. * fix(tui): keep safe mode explicit-only Skip `DATABASE_URL` and libpq environment fallbacks in safe mode so `--no-auto-connect` only connects when a positional target is provided. Track pending saved connection sources so safe mode suppresses automatic reconnects while still honoring explicit CLI saved names, and preserve clipboard failure statuses for connection manager copy actions. * fix(tui): prompt for explicit saved startup passwords Treat saved connection names passed on the CLI like user-picked connects when credential lookup cannot return a password. Automatic reconnects still use the startup fallback, but explicit saved names now open the password prompt instead of the connection picker. * fix(tui): keep pending password switches alive Let saved-connection password resolves complete even if the old active connection reports `ConnectionLost` while credentials are still loading. The pending password generation remains the source of truth for whether a resolve result is current, and successful resolves restore the target connection name before starting the new connection. * fix(tui): bind active names to connect attempts Capture the saved connection name when a connect attempt starts and use that captured value when the matching async connect completes. This prevents an older connect from being recorded under a newer pending saved connection while credentials for the new target are still loading. --------- Co-authored-by: nikita42 <13642481+rekurt@users.noreply.github.com>
1 parent 76ac8cf commit 711956b

6 files changed

Lines changed: 1208 additions & 114 deletions

File tree

0 commit comments

Comments
 (0)