Skip to content

fix(storage): a secure-store read error becomes an empty password, and the next edit can erase the stored one #1303

Closed

Description

@ZhuchkaTriplesix

Problem

ConnectionSecretsStore.readForConnection and readSshSecretsForConnection (lib/core/storage/connection_secrets_store.dart) catch every error and return nulls. Callers cannot tell no secret from the store did not answer (libsecret / Keychain locked, no keyring daemon on Linux).

Consequences:

  1. Misleading error. The drivers (postgres_connection.dart, mysql_connection.dart, redis_connection.dart, mongodb_connection.dart) also wrap the read in catch (_) {} and connect with no password. The user sees Authentication failed. Check the username and password and goes to retype a correct password, when the real problem is the keyring.
  2. Possible erasure. LocalDb.updateConnection reads the previous secrets with the same call, and mergeSecretsForConnectionUpdate merges blank fields from it. If a failed read returns null, the next write stores null, which _FlutterSecureStorageBackend.write turns into a delete: the saved password is gone after an unrelated edit (a rename).

Scope

  • Distinguish absent from unreadable: the read throws (or returns a result type) on a store error.
  • Connect paths surface it as its own error: Could not read the saved password from the system keyring with a hint (unlock the keyring / start the secret service), not as an authentication failure.
  • updateConnection and the secret merge abort without writing when the previous secrets could not be read.

Acceptance

  • A backend whose read throws makes a connect fail with a keyring error, not Authentication failed.
  • Editing a connection while the store cannot be read does not delete the stored password.
  • Reading an absent key still returns null without an error.

Activity

  1. added
    bugSomething isn't working
    storageTheme parser epic label: storage
    coreCore library logic and services
    connectionsDatabase connections, URI parsing, pools
    P1High priority / Core capability
    on Oct 10, 2026
  2. added a commit that references this issue on Oct 10, 2026
  3. ZhuchkaTriplesix commented on Oct 10, 2026

    @ZhuchkaTriplesix
    MemberAuthor

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

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

Metadata

Metadata

Labels

P1High priority / Core capabilitybugSomething isn't workingconnectionsDatabase connections, URI parsing, poolscoreCore library logic and servicesstorageTheme parser epic label: storage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions