-
Notifications
You must be signed in to change notification settings - Fork 41
Logout feature with tokio shutdown_background #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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>
2b69975 to
42b6b5e
Compare
There was a problem hiding this 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() { |
Copilot
AI
May 27, 2025
There was a problem hiding this comment.
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.
A reimplementation of #432 that destroys all room member subscription before Tokio's shutdown_background.