fix: skip app state restore after explicit logout#41
Merged
ZhangHanDong merged 7 commits intomainfrom Apr 3, 2026
Merged
Conversation
e8ac93a to
2ab1b5f
Compare
- Extract duplicated point-of-no-return blocks into enter_point_of_no_return() - Fix missed sender.send().unwrap() on MessageEdited path - Reset display_filter, sort_fn, and drawn_previously on logout - Drain PENDING_ROOM_UPDATES and PENDING_SPACE_UPDATES in ClearAppState handlers
Resolve import conflict in spaces_bar.rs: keep both LogoutAction (from this branch) and AppState/i18n imports (from main).
ZhangHanDong
approved these changes
Apr 3, 2026
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.
Summary
Fixes #31.
This PR fixes the case where, after an explicit logout and then logging back into the same account, the Home area can still show stale UI from the previous session instead of starting from a clean state.
Root Cause
There were multiple pieces contributing to the stale UI during
logout -> re-login:AppStaterestore path could automatically restore the previous Home/dock workspace on the next login.unwrap()and could panic if the receiver had already been dropped during logout/re-login races.Fix
This PR applies three focused fixes:
Skip automatic app-state restore once after explicit logout
handle_load_app_state()consumes that marker and skips restoring the previous persisted Home/dock workspace.Reset room and space widgets on logout
RoomsListandSpacesBarnow clear their session-bound cached UI state whenLogoutAction::ClearAppStateis received.Avoid panicking when timeline receivers are dropped
unwrap().Effect
logout -> re-loginno longer restores the previous Home/dock workspace automatically.SendError(..)panics during logout/re-login races.account switchbehavior is not intentionally changed by this fix.Files changed
src/logout/logout_state_machine.rssrc/sliding_sync.rssrc/persistence/app_state.rssrc/home/rooms_list.rssrc/home/spaces_bar.rsSuggested verification
logout -> re-loginmultiple times. Each cycle should start from a clean workspace.SendError(..)panic occurs during pagination/member-loading while logging out or re-logging in.