Skip to content

Conversation

@alanpoon
Copy link
Contributor

@alanpoon alanpoon commented May 26, 2025

A reimplementation of #432 that destroys all room member subscription before Tokio's shutdown_background.

TigerInYourDream and others added 30 commits March 11, 2025 23:24
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
Signed-off-by: Alvin <zyzzz0928@gmail.com>
@alanpoon alanpoon force-pushed the fix-logout-shutdown branch from 2b69975 to 42b6b5e Compare May 26, 2025 11:21
@alanpoon alanpoon marked this pull request as ready for review May 26, 2025 11:22
@ZhangHanDong ZhangHanDong self-requested a review May 26, 2025 15:12
@emmettlu emmettlu requested a review from Copilot May 27, 2025 09:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reimplements the logout feature by destroying all room member subscriptions before shutting down the Tokio runtime, along with several related cleanup changes and UI updates. Key changes include:

  • Modifications to global state management (e.g., use of Mutex<Option<...>> for CLIENT, REQUEST_SENDER, and sync service).
  • Introduction of a logout process that clears client state, stops sync services, clears caches, and restarts the Tokio runtime.
  • Updates to UI components to support logout confirmation and modal dialogs.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/sliding_sync.rs Refactored async request submission and client access management.
src/shared/mentionable_text_input.rs Added new action for destroying all room subscriptions.
src/room/room_input_bar.rs Integrates handling of the destroy room subscription action.
src/persistent_state.rs New functions for session and last user ID cleanup.
src/login/logout_confirm_modal.rs Added logout confirm modal implementation.
src/login/login_screen.rs Incorporated logout success/failure actions and UI updates.
src/home/spaces_dock.rs Added a logout button widget and updated space dock UI actions.
src/home/main_desktop_ui.rs Introduced a new action to close all tabs during logout.
src/home/editing_pane.rs Triggered room subscription destruction on specific text input action.
src/app.rs Integrated logout modal into the application and updated action flow.

.unwrap() // this is initialized
.send(req)
.expect("BUG: async worker task receiver has died!");
if let Ok(sender_guard) = REQUEST_SENDER.lock() {
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider logging an error or taking appropriate action in the else branch when acquiring the REQUEST_SENDER lock fails, rather than silently ignoring the request submission.

Copilot uses AI. Check for mistakes.
@alanpoon alanpoon added waiting-on-review This issue is waiting to be reviewed and removed waiting-on-review This issue is waiting to be reviewed labels May 27, 2025
@alanpoon alanpoon closed this Jun 3, 2025
@alanpoon alanpoon deleted the fix-logout-shutdown branch October 10, 2025 03:43
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.

2 participants