Skip to content

fix: saved sessions not showing in remote mode (mobile)#173

Merged
PureWeen merged 1 commit intomainfrom
fix/saved-sessions-missing
Feb 21, 2026
Merged

fix: saved sessions not showing in remote mode (mobile)#173
PureWeen merged 1 commit intomainfrom
fix/saved-sessions-missing

Conversation

@PureWeen
Copy link
Owner

Problem

Saved sessions section was empty on mobile (Remote mode). The section header would show but with 0 sessions.

Root Cause

RefreshSessions() in SessionSidebar.razor intentionally skips reloading persisted sessions on every state change — on desktop this is a performance optimization since GetPersistedSessions() scans hundreds of filesystem directories.

However, on mobile (Remote mode), GetPersistedSessions() reads from WsBridgeClient.PersistedSessions which is a cheap in-memory list. The problem:

  1. OnInitialized() calls LoadPersistedSessions() — but bridge hasn't connected yet, so list is empty
  2. Bridge connects and sends persisted_sessions_list → fires OnStateChanged
  3. RefreshSessions() handles the state change but never reloads persisted sessions
  4. Section stays empty forever

Fix

In Remote mode, RefreshSessions() now also refreshes persisted sessions on state change since it's a cheap in-memory read (no filesystem scan). Both the normal and throttled code paths are fixed.

Tests

  • 3 new unit tests for GetPersistedSessions in remote mode (empty before bridge, populated after, round-trip data)
  • 1 new UI scenario: saved-sessions-visible-on-desktop
  • All 1121 tests passing

RefreshSessions() never reloaded persisted sessions after bridge
connected. On mobile (Remote mode), GetPersistedSessions() returns
data from WsBridgeClient.PersistedSessions which is empty at init
time. When the bridge later sends persisted_sessions_list and fires
OnStateChanged, RefreshSessions skipped reloading them (perf opt
for desktop where it scans the filesystem).

Fix: In remote mode, also refresh persisted sessions on state change
since it's a cheap in-memory read from the bridge client.

Added 3 tests and 1 UI scenario for saved sessions visibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit ab95ed5 into main Feb 21, 2026
@PureWeen PureWeen deleted the fix/saved-sessions-missing branch February 22, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant