Skip to content

Improve logout handling and concurrent login detection#1733

Open
paustint wants to merge 1 commit into
mainfrom
bug/fix-desktop-logout-race
Open

Improve logout handling and concurrent login detection#1733
paustint wants to merge 1 commit into
mainfrom
bug/fix-desktop-logout-race

Conversation

@paustint
Copy link
Copy Markdown
Contributor

Enhance the IPC service to better manage logout processes and detect concurrent logins. This update prevents issues where a logout could inadvertently restore an old authentication state, ensuring a smoother user experience.

Copilot AI review requested due to automatic review settings May 17, 2026 18:48
Copy link
Copy Markdown
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 updates the Jetstream Desktop IPC auth flow to avoid race conditions where an in-flight auth verification could accidentally restore (or overwrite) authentication state during logout or a concurrent login.

Changes:

  • Coalesce concurrent logout calls via a shared inFlightLogout promise and expose “logout-in-flight” state to auth checking.
  • Harden checkAuth against concurrent logout/login by re-reading persisted app data before mutating it and bailing out when state has changed.
  • Avoid clearing a valid cached session on transport/network failures during auth verification.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/jetstream-desktop/src/services/ipc.service.ts Outdated
Comment thread apps/jetstream-desktop/src/services/ipc.service.ts Outdated
@paustint paustint force-pushed the bug/fix-desktop-logout-race branch from 38d9508 to a693839 Compare May 18, 2026 15:10
@paustint paustint requested a review from Copilot May 18, 2026 15:24
Copy link
Copy Markdown
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

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

// accessToken with latestAppData.deviceId so we never return a mixed-snapshot authInfo.
return latestAppData.userProfile && latestAppData.deviceId
? {
userProfile: latestAppData.userProfile,
Comment on lines +446 to +448
return latestAppData.userProfile && latestAppData.deviceId
? {
userProfile: latestAppData.userProfile,
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