Closed amunger closed 1 week ago
@bpasero I don't think we do anything special to display this. Why would history return duplicate files?
I reported it here initially: https://github.com/microsoft/vscode/issues/229938
See how on windows there both the /
and \
separators.
Also, I saw this for global symbol search
@amunger @benibenj when this happens, can you "Log Storage Contents" from F1 and find the history.entries
value in workspace storage and diagnose the contents around the duplicates. It is very likely these are actually NOT the same paths when you look at the full absolute resource.
I do not think this issue is related to https://github.com/microsoft/vscode/issues/229938
The paths all seem to match
I have a repro when you have the same editor opened multiple times in the editor grid.
This bug has been fixed in the latest release of VS Code Insiders!
@amunger, you can help us out by commenting /verified
if things are now working as expected.
If things still don't seem right, please ensure you're on version f87f8a56f3a30238076bee3db39c245bd69be264 of Insiders (today's or later - you can use Help: About
in the command palette to check), and leave a comment letting us know what isn't working as expected.
Happy Coding!
I now have these two entries in history.entries, but plenty of duplicates still in there:
"resource": "file:///c%3A/src/vscode-jupyter/src/interactive-window/interactiveWindow.ts#LNaN", "resource": "file:///c%3A/src/vscode-jupyter/src/interactive-window/interactiveWindow.ts",
I'm pretty sure these were populated while I was trying to figure out links in our mermaid chat extension. I did quite a bit of troubleshooting to get the file to open correctly, so this might not be reproable anymore, aside from the entries that I have right now
@amunger but in the case of file:///c%3A/src/vscode-jupyter/src/interactive-window/interactiveWindow.ts
, I see that the resources are not equal, the one has a suffix of #LNaN
. Since this is a URI
, we probably still succeed opening that resource because its the fragment
portion and does not impact the path
.
There seems to be code somewhere that actively opens such as URI
into VS Code, which is not really supported, but we also do not really prevent this from happening.
Our duplication detection in the history service is purely based on URI.toString()
, not taking fragments or query into account.
So we need to figure out how these URIs
get into the system, any steps?
the LNaN URI happens from the mermaid extension not properly validating the result of a parseInt
call and using the result in vscode.commands.executeCommand('vscode.open', uri);
.
There are a bunch of other duplicates in that list in the screenshot that aren't within the history.entries though. Any concern with those?
@amunger and they are not having this fragment part and are 100% same string?
I don't know how to check if they are the same string - there are only two entries in history.entries, and 7 occurrences of interactiveWindow.ts
@amunger thats explained in https://github.com/microsoft/vscode/issues/232426#issuecomment-2443291129, the "recently opened" are stored in workspace storage. I would have not assumed that after a restart you would still see them with my fix.
We hash the editor with a key based on this logic:
The override
parameter would mean that the resource is to open with a different editor than the default.
Maybe you can share the workspace state DB with me.
is that just the contents from "log Storage database contents"? storageDatabaseContents.json
yes, thanks.
Steps to Reproduce:
I have been opening the same file quite a lot recently, and now the quick open menu has several duplicate entries for it: