Skip to content

fix(scm): avoid setting both folderUri and workspace in ResolveConfiguration#456

Merged
NikolaRHristov merged 1 commit into
Currentfrom
fix/scm-duplicate-groups-resolve-configuration
Jun 4, 2026
Merged

fix(scm): avoid setting both folderUri and workspace in ResolveConfiguration#456
NikolaRHristov merged 1 commit into
Currentfrom
fix/scm-duplicate-groups-resolve-configuration

Conversation

@NikolaRHristov
Copy link
Copy Markdown
Member

Problem

The SCM Source Control view renders duplicate group rows (Staged Changes, Untracked Changes, Merge Changes, Changes appear twice each) when opening a folder in Mountain.

Root cause: ResolveConfiguration was setting both folderUri and workspace to the same folder path. The workbench has two independent workspace resolution paths:

  • folderUri is read by the browser workbench
  • workspace (ISingleFolderWorkspaceIdentifier) is read by DesktopMain.reviveIdentifier()

With both set, the Git extension calls registerSCMProvider twice for the same repository, producing 8 group rows instead of 4 in the SCM tree.

Fix

Mutually exclude folderUri and workspace based on runtime context:

  • Tauri/Mountain (__TAURI_INTERNALS__ present): pass workspace only, set folderUri: undefined
  • Browser (no Tauri): pass folderUri only, set workspace: undefined

Changed file

Source/Function/Install/Function/ResolveConfiguration.ts

-	folderUri: FolderUri,
-	workspace: Workspace,
+	// IsTauri = typeof ResolveInvoke() === "function"
+	folderUri: IsTauri ? undefined : FolderUri,
+	workspace: IsTauri ? Workspace : undefined,

…uration

Setting both causes the workbench to register the same git repo twice,
producing duplicate SCM group rows (Staged Changes, Changes, etc.).

In Tauri/desktop context (Mountain), only workspace is read by DesktopMain.
In browser context, only folderUri is read. Mutually exclude them.
@NikolaRHristov NikolaRHristov merged commit 54a9ae9 into Current Jun 4, 2026
8 of 11 checks passed
@NikolaRHristov NikolaRHristov deleted the fix/scm-duplicate-groups-resolve-configuration branch June 4, 2026 21:05
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.

1 participant