sessions: return to sign-in screen after sign out (#307660)#307781
sessions: return to sign-in screen after sign out (#307660)#307781hawkticehurst wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Agents (“sessions”) sign-out flow so that, after signing out, the app returns users to the Sessions welcome/sign-in walkthrough instead of leaving them in a partially signed-in state.
Changes:
- Await the default account sign-out command to ensure the sign-out flow completes before downstream logic runs.
- Introduce a shared
WELCOME_COMPLETE_KEYconstant and update welcome logic to treatUnknownentitlement differently depending on whether welcome was previously completed. - Add unit coverage for the sign-out → entitlement
Unknown→ welcome overlay behavior, and for canceled sign-out.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/accounts/browser/defaultAccount.ts | Awaits the underlying sign-out command to make sign-out completion deterministic. |
| src/vs/sessions/common/welcome.ts | Adds a shared export for the sessions welcome completion storage key. |
| src/vs/sessions/contrib/welcome/browser/welcome.contribution.ts | Uses the shared key and updates entitlement watching logic to optionally include Unknown when welcome completion is cleared. |
| src/vs/sessions/contrib/welcome/test/browser/welcome.contribution.test.ts | Adds regression coverage for explicit sign-out behavior (welcome key cleared + Unknown entitlement shows overlay). |
| src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts | Introduces a sign-out helper that waits for entitlement to become Unknown before resetting the sessions welcome flow. |
| src/vs/sessions/contrib/accountMenu/test/browser/account.contribution.test.ts | Adds tests validating sign-out sequencing and ensuring canceled sign-out does not reset the welcome flow. |
src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts
Outdated
Show resolved
Hide resolved
src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts
Outdated
Show resolved
Hide resolved
Wait for the default account sign-out flow to finish before resetting the sessions welcome state, then reopen the welcome overlay once entitlement falls back to Unknown. This preserves the existing transient Unknown handling for token refreshes while making explicit sign-out immediately return users to the sign-in screen and block the sessions UI until they sign in again. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ef7dd83 to
cca35bb
Compare
|
Rebased this PR onto the latest Updates in
Validation rerun after the rebase:
The local Electron unit-test harness is still crashing before loading targeted tests in this environment, so I wasn’t able to rerun those here. |
|
Addressed the latest Copilot review feedback in a follow-up update. Latest change:
I intentionally did not add a timeout fallback here because resetting the welcome flow before entitlement reaches Validation rerun:
|
Attach the entitlement listener before re-checking for the Unknown state so the sessions sign-out flow cannot miss the transition while the listener is being registered. Also add regression coverage for the edge case while preserving the existing welcome-reset behavior after sign-out. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes #307660
Summary
UnknownUnknownentitlement handling unchanged for token refreshes and add regression coverage for the sign-out pathTesting
npm run compile-check-ts-nativenpm run valid-layers-checknode --experimental-strip-types build/hygiene.ts src/vs/sessions/common/welcome.ts src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts src/vs/sessions/contrib/accountMenu/test/browser/account.contribution.test.ts src/vs/sessions/contrib/welcome/browser/welcome.contribution.ts src/vs/sessions/contrib/welcome/test/browser/welcome.contribution.test.ts src/vs/workbench/services/accounts/browser/defaultAccount.tsNotes
test/unit/electron/index.jsseesappasundefined).