Skip to content

sessions: fix endless spinner in Changes view for non-git folders - #324132

Merged
Ladislau Szomoru (lszomoru) merged 1 commit into
microsoft:mainfrom
SparshGarg999:issue-324066-changes-spinner
Jul 3, 2026
Merged

Ladislau Szomoru (lszomoru) merged 1 commit into
microsoft:mainfrom
SparshGarg999:issue-324066-changes-spinner

Conversation

@SparshGarg999

Copy link
Copy Markdown
Contributor

This PR fixes GitHub issue #324066: endless loading spinner in the Changes view when opening non-git directories.

Root Cause Analysis

For non-git workspaces or non-git folders, activeSessionHasGitRepositoryObs in ChangesViewService evaluates to false. When there's no Git repository, the changeset's isLoadingChanges can remain stuck in a loading state if it tries to resolve refs via Git. Specifically, in UncommittedChangesChangeset and other git-backed changesets, isLoadingChanges evaluates to true whenever the changeset resolver returns undefined.

In GitRepositoryChangesetResolver.resolve(...), if repositoryUri is not present, it returns undefined. Because it returns undefined, changesPromiseObs.read(reader).read(reader) remains undefined, which keeps the changeset's isLoadingChanges stuck as true indefinitely. This propagates up to the UI, leading to an endless spinner.

Fix

Modify GitRepositoryChangesetResolver.resolve(...) to return an empty array [] instead of undefined when the repository is not available. This signals to the changeset state observable that the resolution has completed (yielding no changes) rather than indicating that it is still loading.

Copilot AI review requested due to automatic review settings July 3, 2026 00:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 issue #324066, where the Changes view showed an endless loading spinner when a session's workspace folder is not a git repository. The root cause is that GitRepositoryChangesetResolver.resolve(...) returned undefined when no repository URI was available, and the downstream changeset observables interpret an undefined resolved value as "still loading", which never clears. The fix returns an empty array instead, signaling a completed resolution with no changes.

Changes:

  • In GitRepositoryChangesetResolver.resolve(...), return [] instead of undefined when there is no repository URI, so isLoadingChanges resolves to false for non-git folders.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

@lszomoru
Ladislau Szomoru (lszomoru) merged commit 190016f into microsoft:main Jul 3, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.128.0 milestone Jul 3, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 17, 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.

5 participants