fix: saved sessions not showing in remote mode (mobile)#173
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Saved sessions section was empty on mobile (Remote mode). The section header would show but with 0 sessions.
Root Cause
RefreshSessions()inSessionSidebar.razorintentionally skips reloading persisted sessions on every state change — on desktop this is a performance optimization sinceGetPersistedSessions()scans hundreds of filesystem directories.However, on mobile (Remote mode),
GetPersistedSessions()reads fromWsBridgeClient.PersistedSessionswhich is a cheap in-memory list. The problem:OnInitialized()callsLoadPersistedSessions()— but bridge hasn't connected yet, so list is emptypersisted_sessions_list→ firesOnStateChangedRefreshSessions()handles the state change but never reloads persisted sessionsFix
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
GetPersistedSessionsin remote mode (empty before bridge, populated after, round-trip data)saved-sessions-visible-on-desktop