fix: refresh recent connections once connections are loaded #5

Closed
adrianbonpin wants to merge 1 commits from fix/recent-connections-race into prod
Owner

Fixes the Recent connections strip appearing empty/flaky.

Bug

The Recent strip is populated by loadRecent(), which maps cached recent IDs against get().connections. The app-shell mounts loadAll() and HomeScreen's mount effect fires loadRecent() concurrently. When loadRecent resolves first, connections is still [], so every recent entry is filtered out and the strip renders empty — and it never refreshes after connections arrive (only a remount would fix it).

Fix

loadAll() now calls loadRecent() after connections are populated, so the strip is computed deterministically against the real connection list on startup.

Tests

  • Added loadAll refreshes recents once connections are known (reproduces the race).
  • Added loadRecent maps cached recent ids against the current connection list.
  • Full desktop frontend suite: 1076 tests pass.
Fixes the Recent connections strip appearing empty/flaky. # Bug The Recent strip is populated by `loadRecent()`, which maps cached recent IDs against `get().connections`. The app-shell mounts `loadAll()` and `HomeScreen`'s mount effect fires `loadRecent()` concurrently. When `loadRecent` resolves first, `connections` is still `[]`, so every recent entry is filtered out and the strip renders empty — and it never refreshes after connections arrive (only a remount would fix it). # Fix `loadAll()` now calls `loadRecent()` after connections are populated, so the strip is computed deterministically against the real connection list on startup. # Tests - Added `loadAll refreshes recents once connections are known` (reproduces the race). - Added `loadRecent maps cached recent ids against the current connection list`. - Full desktop frontend suite: 1076 tests pass.
adrianbonpin added 1 commit 2026-08-31 21:13:41 +00:00
The Recent strip was computed from get().connections which is still empty
while loadAll() is in flight on app startup, so cached recent IDs got
filtered out and the strip could appear empty/flaky until a remount.

loadAll now refreshes recents after connections populate.
adrianbonpin closed this pull request 2026-08-31 21:17:54 +00:00
adrianbonpin deleted branch fix/recent-connections-race 2026-08-31 21:17:54 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adrianbonpin/gridline#5