Summary
In LocalDb.getConnections (lib/core/storage/local_db.dart, lines 430–454):
final futures = rows.map((m) => _hydrateConnection(ConnectionRow.fromMap(m)));
return Future.wait(futures);
Where _hydrateConnection unconditionally awaits:
final secrets = await ConnectionSecretsStore.readForConnection(row.id!);
- Unbounded Parallel Keychain Requests: For N saved connections, Querya launches 2*N simultaneous OS secure storage reads (password and connection_string) on application startup. On Linux (D-Bus
org.freedesktop.secrets) and macOS (Keychain), this causes lock contention, IPC bottlenecks, and timeouts (org.freedesktop.DBus.Error.NoReply).
- Missing Error Handling:
_hydrateConnection lacks a try/catch block. If the platform secure store is locked or unavailable (e.g. minimal Linux setup without gnome-keyring or canceled prompt), getConnections() throws, failing to populate the entire connections tree in the sidebar.
- Unnecessary Eager Resolution: The sidebar tree only requires basic connection metadata (name, host, type, folder). Password and connection string secrets are not needed until the user explicitly initiates a database connection.
Repro
- Add 20+ database connections.
- Launch Querya on Linux or macOS.
- Observe high startup latency or D-Bus timeout errors when hydrating connections; if secure storage errors, no connections render in the UI.
Scope
- Do not eagerly fetch passwords and connection strings for all connections in
getConnections().
- Add
try/catch in _hydrateConnection and secret store readers to log errors gracefully and preserve basic row data rather than aborting connection tree rendering.
- Resolve secrets on-demand when
connect() is invoked for a specific connection.
Out of scope
- Changing the underlying SQLite schema.
Summary
In
LocalDb.getConnections(lib/core/storage/local_db.dart, lines 430–454):Where
_hydrateConnectionunconditionally awaits:org.freedesktop.secrets) and macOS (Keychain), this causes lock contention, IPC bottlenecks, and timeouts (org.freedesktop.DBus.Error.NoReply)._hydrateConnectionlacks atry/catchblock. If the platform secure store is locked or unavailable (e.g. minimal Linux setup without gnome-keyring or canceled prompt),getConnections()throws, failing to populate the entire connections tree in the sidebar.Repro
Scope
getConnections().try/catchin_hydrateConnectionand secret store readers to log errors gracefully and preserve basic row data rather than aborting connection tree rendering.connect()is invoked for a specific connection.Out of scope