Skip to content

perf(azure): throttle parallel tenant sign-in checks with shared concurrency limiter#694

Open
hanhan761 wants to merge 3 commits into
microsoft:mainfrom
hanhan761:perf-688-throttle-tenant-signin
Open

perf(azure): throttle parallel tenant sign-in checks with shared concurrency limiter#694
hanhan761 wants to merge 3 commits into
microsoft:mainfrom
hanhan761:perf-688-throttle-tenant-signin

Conversation

@hanhan761

Copy link
Copy Markdown

@

Summary

Replace unbounded Promise.all fan-outs against the Azure Identity endpoint with a shared ConcurrencyLimiter (concurrency: 5).

For corporate users with many tenants, the original code issued unlimited parallel isSignedIn calls against Microsoft Entra — the same anti-pattern fixed for estimateDocumentCount in #685.

Issue

Fixes #688

Changes

File Change
api-shared/azure/tenantSignInLimiter.ts New — shared ConcurrencyLimiter (concurrency: 5)
credentialsManagement/SelectAccountStep.ts Import limiter, wrap isSignedIn calls
subscriptionFiltering/InitializeFilteringStep.ts Import limiter, wrap isSignedIn calls

Verification

  • npm run build — TypeScript compilation passes
  • npm run lint — ESLint passes
  • npm run prettier-fix — formatting confirmed
    @

hanhan761 added 3 commits May 29, 2026 20:43
@
feat(tree): show index count on Indexes folder node

Add lazy-loaded index count as the description on IndexesItem
tree items (e.g., "5 indexes" or "1 index"), following the same
pattern used by CollectionItem for document counts. The count is
fetched asynchronously via listIndexes() and includes search
indexes when supported by the platform.

Also add a stale-check guard (isCurrent) to IndexesItem so that
in-flight count work is discarded when the owning CollectionItem
is recreated on refresh or re-expand.

Closes microsoft#659
@
@
fix(tree): hide single-item context menu commands when multiple items selected

Add `&& !listMultiSelection` to the `when` clause of 36 context
menu commands in the Connections tree view. When multiple items
are selected (`listMultiSelection` is true), single-item commands
are now hidden, preventing silent failures or unexpected behavior.

Commands already supporting multi-select (removeConnection,
moveItems) and discovery-view-only commands are intentionally
left unchanged.

Closes microsoft#668
@
@
perf(azure): throttle parallel tenant sign-in checks with shared concurrency limiter

Replace unbounded Promise.all fan-outs against the Azure Identity
endpoint with a shared ConcurrencyLimiter (concurrency: 5). For
corporate users with many tenants, the original code issued an
unlimited number of parallel isSignedIn calls against Microsoft
Entra — the same anti-pattern that caused issues with
estimateDocumentCount in microsoft#685.

New shared limiter at api-shared/azure/tenantSignInLimiter.ts is
imported by both SelectAccountStep and InitializeFilteringStep,
ensuring total parallelism is bounded across the wizard.

Closes microsoft#688
@
Copilot AI review requested due to automatic review settings May 29, 2026 13:14
@hanhan761 hanhan761 requested a review from a team as a code owner May 29, 2026 13:14
@tnaum-ms tnaum-ms added the in-triage-queue We've seen your input and will triage it label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-triage-queue We've seen your input and will triage it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: throttle parallel Azure tenant sign-in checks

2 participants