Skip to content

fix(storage): secrets cannot be cleared on edit, stale SSH secrets stay after SSH is turned off, and a failed save restores only part of them #1311

Description

@ZhuchkaTriplesix

Problem

lib/features/connections/connection_edit_secrets.dart, lib/core/storage/connection_secrets_store.dart, lib/core/storage/local_db.dart (updateConnection):

  1. No way to clear. A blank password / SSH field means keep the previous one, and the form never shows the stored value, so a saved password cannot be removed (the database moved to trust authentication, the SSH key is gone).
  2. Stale SSH secrets. writeForConnection writes SSH secrets only when one of them is non-null. Turning SSH off leaves the old password, private key and passphrase in the keyring until the connection is deleted.
  3. Partial rollback. When writing secrets fails, updateConnection restores the previous row and the password / connection string, but not the SSH secrets, which may already be partly overwritten (writeSshSecretsForConnection writes four keys one by one).
  4. writeSshSecretsForConnection writes all four keys: a caller that passes only one nulls the other three.

Scope

  • An explicit Remove saved password / Remove saved SSH secrets action in the forms (a tri-state: keep / replace / clear).
  • Delete SSH secrets when the tunnel is disabled.
  • Snapshot and restore all secrets (database and SSH) on a failed update.
  • Tests with a fake backend: clear, disable SSH, failing write mid-way.

Acceptance

  • A saved password can be removed from the edit form, and the next connect sends none.
  • After disabling SSH no SSH secret is left in the store.
  • A failed update leaves every secret as it was.

Activity

  1. added
    bugSomething isn't working
    storageTheme parser epic label: storage
    connectionsDatabase connections, URI parsing, pools
    P2Medium priority / Parity & Refactoring
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 10, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Сделано в #1330, смержено в dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Medium priority / Parity & RefactoringbugSomething isn't workingconnectionsDatabase connections, URI parsing, poolsstorageTheme parser epic label: storage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions