From bf61b493ac19295b558d858a468b6a263791c47b Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Tue, 16 Jun 2026 15:44:28 +0300 Subject: [PATCH] perf(connections): load connection secrets concurrently on startup Speeds up Connection list loading by replacing sequential secure storage reads in a loop with concurrent . --- lib/core/storage/local_db.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/core/storage/local_db.dart b/lib/core/storage/local_db.dart index 50180aeb..bfac6e3e 100644 --- a/lib/core/storage/local_db.dart +++ b/lib/core/storage/local_db.dart @@ -327,11 +327,8 @@ class LocalDb { Future> getConnections() async { final db = await _open(); final rows = await db.query('connections', orderBy: 'sort_order ASC, name ASC'); - final out = []; - for (final m in rows) { - out.add(await _hydrateConnection(ConnectionRow.fromMap(m))); - } - return out; + final futures = rows.map((m) => _hydrateConnection(ConnectionRow.fromMap(m))); + return Future.wait(futures); } static Future _hydrateConnection(ConnectionRow row) async {