Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yet another "Element with id is already registered" #3341

Open
DavideCanton opened this issue Jun 7, 2024 · 2 comments
Open

Yet another "Element with id is already registered" #3341

DavideCanton opened this issue Jun 7, 2024 · 2 comments
Labels
bug Something isn't working support-triaged Support has reviewed, verified, or reproduced this

Comments

@DavideCanton
Copy link

Description

In a simple repository, right clicking on a branch and choosing "Compare with HEAD", an error notification appears with the message

Element with id gitlens://viewnode/results-commits/branch-status-direction/behind/comparison/HEAD+master+16 is already registered

Refreshing the compare does not fix it, swapping the branches using the double arrow does.
Also it's not always reproducible, it seems kinda random.

GitLens Version

15.0.4

VS Code Version

Version: 1.90.0 (system setup)
Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
Date: 2024-06-04T19:33:54.889Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19043

Git Version

git version 2.42.0.windows.2

Logs, Screenshots, Screen Captures, etc

In the last rows of the debug log, there were these rows:

[2024-06-07 00:49:40.436] [  9a5] CompareResultsNode(gitlens://viewnode/compare-results/comparison/HEAD+master+16).ensureSubscription
[2024-06-07 00:49:40.436] [  9a5] CompareResultsNode(gitlens://viewnode/compare-results/comparison/HEAD+master+16).ensureSubscription completed [0ms]
[2024-06-07 00:49:40.436] [  9a6] CompareResultsNode(gitlens://viewnode/compare-results/comparison/HEAD+master+16).ensureSubscription
[2024-06-07 00:49:40.437] [  9a6] CompareResultsNode(gitlens://viewnode/compare-results/comparison/HEAD+master+16).ensureSubscription completed [0ms]

I suspect that for some reason some code runs twice and tries to register the same element twice.

Here there is a gif reproducing the issue:
issue

@DavideCanton DavideCanton added bug Something isn't working triage Needs to be looked at labels Jun 7, 2024
@jkelroy jkelroy added support-triaged Support has reviewed, verified, or reproduced this and removed triage Needs to be looked at labels Jun 11, 2024
@jkelroy
Copy link

jkelroy commented Jun 11, 2024

This seems to only happen when right-clicking a branch in the branch sidebar - I do not see this behavior when using Compare with HEAD from the commit graph.

I can consistently reproduce this when using Compare with HEAD twice. i.e.

  • Have GitLens repo open
  • Switch to feature/GLVSC-504-lp-link-to-gkdev
  • Right-click main > Compare with HEAD - repeat

@ohliumliu
Copy link

My observation is this

  • Starting with no prior history in "History & Compare"
  • Compare an old commit with head by right click the old commit and select compare with head -> History & Compare doesn't show the result under "Comparing HEAD with commit-hash".
  • Click the button "Open All Changes" can show the changes in the editor.
  • Do this -- "Compare an old commit with head by right click the old commit and select compare with head" -- for a second time -> History & Compare show results for both comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working support-triaged Support has reviewed, verified, or reproduced this
Projects
None yet
Development

No branches or pull requests

3 participants