Skip to content

Fix "Downloading .NET..." status bar indicator not clearing after download completes#2607

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-status-downloading-dotnet
Open

Fix "Downloading .NET..." status bar indicator not clearing after download completes#2607
Copilot wants to merge 4 commits intomainfrom
copilot/fix-status-downloading-dotnet

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

StatusBarObserver had no awareness of concurrent downloads — it hid the status bar on the first DotnetAcquisitionCompleted event received, even if other downloads were still in progress. It also never handled DotnetAcquisitionFinalError, leaving the indicator permanently visible on download failure.

Changes

  • StatusBarObserver: Add inProgressDownloads: string[] tracking (consistent with OutputChannelObserver) to gate resetAndHideStatusBar() on all downloads finishing:

    • DotnetAcquisitionStart → push installId, show indicator
    • DotnetAcquisitionCompleted / DotnetInstallExpectedAbort → remove installId, hide if empty
    • DotnetAcquisitionFinalError (new) → remove installId, hide if empty (indicator was stuck forever on failure)
    • DotnetAcquisitionError → unchanged (always show error state)
  • StatusBarObserver.test.ts: New unit tests covering single download lifecycle, concurrent download tracking (stays visible while any download is in progress), abort, and final-error scenarios.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • microsoft.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/vscode-dotnet-runtime/vscode-dotnet-runtime/vscode-dotnet-runtime-library/node_modules/.bin/mocha -u tdd -- dist/test/unit/DebianDistroTests.test.js dist/test/unit/DotnetConditionValidator.test.js dist/test/unit/DotnetCoreAcquisitionWorker.test.js dist/test/unit/DotnetPathFinder.test.js dist/test/unit/DotnetResolver.test.js dist/test/unit/ErrorHandler.test.js dist/test/unit/ExecutableArchitectureDetector.test.js dist/test/unit/ExistingPathResolver.test.js dist/test/unit/GlobalInstallerResolver.test.js dist/test/unit/InstallScriptAcquisitionWorker.test.js dist/test/unit/InstallTracker.test.js dist/test/unit/InstallationValidator.test.js dist/test/unit/IssueReporter.test.js dist/test/unit/JsonInstaller.test.js dist/test/unit/LinuxDistroTests.test.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Incorrect status "Downloading .NET" shown</issue_title>
<issue_description>### Describe the bug.

I run code-insiders . in roslyn folder of dotnet/roslyn project. Ran a test (ie. project system finished loading) and the status bar still shows "Downloading .NET".

When I click on that status, it opens that Output pane, which shows that it's no longer downloading .NET.

Image

Please attach log file(s) here if you have any.

Sorry, I didn't find any logs matching the description above. When I look at the two folders created today in the folder you described, I only see a cli.log file:

Image

Reproduction Steps

  1. open the project
  2. wait
  3. status keeps showing "Downloading .NET"

Expected Behavior

I would expect "Downloading .NET" to disappear at some point or be replaced by some other more up-to-date status.

Exceptions & Errors (if any)

No response

.NET Install Tool Version

3.0.0

Your operating system? Please provide more detail, such as the version and or distro above.

Windows

VS Code Version

Version: 1.111.0-insider (user setup) Commit: 3d96350ed546b786ace7de5ff1d13ab7433073f6</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect status message for .NET downloading Fix "Downloading .NET..." status bar indicator not clearing after download completes Mar 11, 2026
nagilson and others added 2 commits April 8, 2026 15:12
… requests

Address review feedback: two extensions (e.g. C# and C# Dev Kit) can request
the same installId simultaneously. In the global SDK path, DotnetAcquisitionStarted
fires before the inner installer lock, so duplicate start events are possible
with only one completion event following.

Changing from string[] to Set<string> makes tracking idempotent - duplicate
starts for the same installId are naturally deduplicated, so a single
completion correctly clears the tracking and hides the status bar.

Added tests for:
- Duplicate installId starts with single completion
- Completion for unknown installId (graceful no-op)
- Mixed completion/error with duplicate starts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nagilson nagilson requested a review from Copilot April 8, 2026 23:47
@nagilson nagilson marked this pull request as ready for review April 8, 2026 23:47
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 fixes the “Downloading .NET...” status bar indicator lifecycle in the runtime acquisition library by tracking concurrent acquisitions and clearing the indicator only when all downloads have finished (including failure/abort paths).

Changes:

  • Add inProgressDownloads tracking in StatusBarObserver to avoid clearing the status bar while other downloads are still running.
  • Handle DotnetAcquisitionFinalError to ensure the indicator clears on download failure.
  • Add unit tests covering single and concurrent download lifecycles, aborts, and final-error scenarios.

Reviewed changes

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

File Description
vscode-dotnet-runtime-library/src/EventStream/StatusBarObserver.ts Track active installIds and only hide/reset the status bar when the last in-progress acquisition completes/aborts/fails.
vscode-dotnet-runtime-library/src/test/unit/StatusBarObserver.test.ts New unit tests to validate correct status bar visibility with concurrency and error/abort flows.

Comment on lines +143 to +150
test('Status bar hides correctly when same installId is started twice (duplicate request)', () =>
{
// Simulates the global SDK path where DotnetAcquisitionStarted fires before the inner lock,
// so two extensions requesting the same version can each trigger a start event.
const install = makeInstall('8.0~x64');
observer.post(new DotnetAcquisitionStarted(install, 'ext-csharp'));
observer.post(new DotnetAcquisitionStarted(install, 'ext-csharpdk'));

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests that aim to simulate “different extensions requesting the same version” are passing the extension id as the 2nd constructor argument to DotnetAcquisitionStarted, but that parameter is startingVersion (the requesting extension id is the 3rd parameter). This makes the scenario/comment misleading and could hide future regressions if the observer ever starts relying on requestingExtensionId.

Consider constructing DotnetAcquisitionStarted with both a realistic startingVersion (e.g., the version being acquired) and the requestingExtensionId as the 3rd argument, and/or updating the comment to match what the test actually does.

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +87
if (installId)
{
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removeFromInProgress uses a different brace style than the rest of this file (and the surrounding code in this method), which is likely to trip formatting/lint rules or at least makes the style inconsistent. Consider formatting the if block consistently with the file’s existing style.

Suggested change
if (installId)
{
if (installId) {

Copilot uses AI. Check for mistakes.
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.

Incorrect status "Downloading .NET" shown

3 participants