refresh default account in regular intervals#288962
Merged
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
lszomoru
approved these changes
Jan 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements periodic refreshing of default account data to keep authentication and entitlement information up-to-date. The file defaultAccount.ts is moved from the common folder to the browser folder to accommodate the use of browser-specific services.
Changes:
- Adds periodic polling (every 15 minutes) to refresh default account data
- Implements immediate refresh when the window regains focus
- Refactors session fetching logic into separate methods for better separation of concerns
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/accounts/browser/defaultAccount.ts | Adds RunOnceScheduler for 15-minute polling, IHostService for focus detection, implements window focus handler, refactors getDefaultAccountFromAuthenticatedSessions method |
| src/vs/workbench/workbench.common.main.ts | Updates import path from common to browser folder |
| src/vs/workbench/services/policies/test/browser/multiplexPolicyService.test.ts | Updates import path from common to browser folder |
| src/vs/workbench/services/policies/test/browser/accountPolicyService.test.ts | Updates import path from common to browser folder |
| src/vs/workbench/electron-browser/desktop.main.ts | Updates import path from common to browser folder |
| src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts | Updates import path from common to browser folder |
| src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts | Updates import path from common to browser folder |
| src/vs/workbench/browser/web.main.ts | Updates import path from common to browser folder |
Comments suppressed due to low confidence (2)
src/vs/workbench/services/accounts/browser/defaultAccount.ts:361
- The delay parameter passed to schedule is redundant since the same value was already provided to the RunOnceScheduler constructor. You can call schedule without parameters to use the default delay, or remove the delay from the constructor if you prefer to specify it at call time.
src/vs/workbench/services/accounts/browser/defaultAccount.ts:205 - The new polling mechanism lacks documentation. Consider adding a JSDoc comment above the
accountDataPollSchedulerfield to explain that it periodically refreshes the default account data every 15 minutes and is reset when the window regains focus.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.