vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

"Element with id already registered" error when Search & Compare view opens to show a comparison

Open axosoft-ramint opened this issue 1 year ago • 4 comments

Description

To repro, use a command like "compare to/with ..." on a commit/branch on the graph or branches view while the Search & Compare view is closed/minimized/hidden.

It will open the comparison but then immediately it will vanish, with the error "element with id already registered". Refreshing the Search & compare view fixes the issue and the comparison shows correctly.

GitLens Version

2024.8.205 (pre-release)

VS Code Version

No response

Git Version

No response

Logs, Screenshots, Screen Captures, etc

No response

axosoft-ramint avatar Aug 02 '24 16:08 axosoft-ramint

Me too - also, I believe the behaviour has changed. Currently if I right-click a commit and choose 'Select for compare' it immediately switches to GitLens Search and Compare - even though only one party for the comparison has been chosen - is this related?

easyTree avatar Aug 05 '24 17:08 easyTree

@easyTree Shouldn't be related, but definitely an issue. I've opened https://github.com/gitkraken/vscode-gitlens/issues/3448 to track it

eamodio avatar Aug 05 '24 22:08 eamodio

Tried to reproduce. For me it's reproduced only twice and then I can not reproduce it again, it's strange

nzaytsev avatar Aug 07 '24 06:08 nzaytsev

Have the same issue for a year now. At first I thought that it's my local installation was corrupted, but then I've faced with the same problem on my colleague's installation too. Both are on Linux so, maybe it's OS-related.

Every time I'm trying to perform a Search with GitLens Search&Compare widget at first results are shown, then the error appears and Search results is collapsed in the list. When you're trying to expand search result - the same error appears. However, if you will perform another search using + button at the top of the widget - it will allow you to expand new search results just fine, so I'm using it as a workaround for now :)

Bug

If you need any details, I will help to provide it.

My current versions info: Arch Linux asus 6.9.3-arch1-1 SMP PREEMPT_DYNAMIC Fri, 31 May 2024 15:14:45 +0000 x86_64 GNU/Linux VS-Code OSS 1.90.0 Electron 29.4.3

ayuzvyak avatar Sep 12 '24 07:09 ayuzvyak

It also happens for me, when i try to expand a branch from my branches view it starts loading for a bit then i am prompted with an error Element with id gitlens://viewnode/compare-branch/repo/bla bla bla is already registered. It's extremely annoying and it happens arbitrary. The "fix" for it is to manually fetch from origin

RClaudiuM avatar Nov 29 '24 07:11 RClaudiuM

I can reproduce this consistently if I search for commits by message. It works the first time, but future searches fail. It is a very annoying bug since this is the primary feature I use GitLens for. I'm on Windows so this is not Linux specific. The only unusual feature that I'm aware that I'm using is worktrees.

michaelmesser avatar Dec 03 '24 16:12 michaelmesser

I had the issue with Search and Compare but it has worked for me in a while now. However, most of my colleagues have this issue and can reproduce it consistently if needed.

pdc-joss avatar Dec 05 '24 13:12 pdc-joss

When I start a new search it works fine. When I update the search, I get the error "Element with id gitlens://viewnode/search/change:... is already registered". Clearing the search and starting a new search works again fine. I was doing this yesterday many times using vscode insider and GitLens release and never experienced an issue, but this started today.

I'm experiencing this with vscode 1.96.2 and the latest 1.97.0-insider. I had it with GitLens 16.1.1, so switched to 2025.1.904, but still see it.

Version: 1.97.0-insider (system setup)
Commit: 2569d71b0491afddb23e173ee6cc2eb284f1b0b9
Date: 2025-01-08T13:30:54.238Z
Electron: 32.2.7
ElectronBuildId: 10660205
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Version: 1.96.2 (system setup)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Fydon avatar Jan 09 '25 12:01 Fydon

Fixed by 3115830862acc933f2b1f927b8859b472304a6a8 and 7b29beffa6f07ed6b6b69487cc01113aef4682ea

eamodio avatar May 31 '25 04:05 eamodio

Can you please verify this fix in tomorrow's (v2025.6.01xx) pre-release edition of GitLens? Thank you so much!

You can switch to the pre-release edition of GitLens, by clicking on the "Switch to Pre-Release version of this extension" from the Extensions view.

image

eamodio avatar May 31 '25 04:05 eamodio

Verified in today's pre-release.

axosoft-ramint avatar Jun 03 '25 19:06 axosoft-ramint

Issue still occurring on pre-release as of today. MacOS, gitlens 17.3.1

jhartman86 avatar Jul 21 '25 15:07 jhartman86

@jhartman86 can you provide more details on when/where you see this? And is it reproducible?

eamodio avatar Jul 29 '25 04:07 eamodio

@eamodio it is reproducible, and I believe it's caused by having a workspace configured with multiple repos in it (each subdirectory of the workspace is itself a git repo... I'm guessing that's relevant).

Easiest way to get it to trigger is opening Gitlens Inspect > Compare References, and picking two SHAs to compare. It happens every time. That said, it had worked fine for a long time until recently.

If there's a way to pull a debug log or anything that'd be helpful just lmk and I'll post it back here.

Thanks!

jhartman86 avatar Aug 06 '25 17:08 jhartman86

Still occurring with me too.

larrasket avatar Aug 11 '25 22:08 larrasket

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 11 '25 05:09 github-actions[bot]