Skip to content

refresh default account in regular intervals#288962

Merged
sandy081 merged 1 commit intomainfrom
sandy081/naked-mockingbird
Jan 19, 2026
Merged

refresh default account in regular intervals#288962
sandy081 merged 1 commit intomainfrom
sandy081/naked-mockingbird

Conversation

@sandy081
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 19, 2026 18:45
@sandy081 sandy081 enabled auto-merge (squash) January 19, 2026 18:45
@sandy081 sandy081 self-assigned this Jan 19, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/browser/web.main.ts
  • src/vs/workbench/electron-browser/desktop.main.ts

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 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 accountDataPollScheduler field to explain that it periodically refreshes the default account data every 15 minutes and is reset when the window regains focus.

@sandy081 sandy081 merged commit 11f7fff into main Jan 19, 2026
27 of 28 checks passed
@sandy081 sandy081 deleted the sandy081/naked-mockingbird branch January 19, 2026 19:09
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants