microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

Local History stopped working. #214060

Closed amarcuvitz closed 3 months ago

amarcuvitz commented 3 months ago

Type: Bug

Edit a file. Save. No no entry appears in Timeline or in Local History: dropdown. When dropdown opens "File Saved March 17 ..." is the last entry. Git commits appear in TimeLine normally.

VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700H (20 x 2688)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.69GB (13.85GB free)| |Process Argv|--crash-reporter-id 33c2f2a7-2eca-42b3-8c79-c0ec70ec45a3| |Screen Reader|no| |VM|0%|
Extensions (19) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.5.0 copilot|Git|1.197.0 copilot-chat|Git|0.15.2 todo-tree|Gru|0.0.226 tgit-cmds|mbi|1.4.2 git-graph|mhu|1.30.0 prettify-json|moh|0.0.3 debugpy|ms-|2024.7.11371017 isort|ms-|2023.10.1 python|ms-|2024.7.11511013 vscode-pylance|ms-|2024.5.103 jupyter|ms-|2024.4.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-containers|ms-|0.362.0 tortoisegit-buttons-in-vscode|Puv|0.1.37 vscode-decompiler|tin|0.1.0
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 f8hc8238:30694864 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31064719 chatpanelt:31048053 dsvsc021:30996838 g316j359:31013175 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31061160 pythonprt:31056678 dwnewjupytercf:31046870 26j00206:31048877 ```
amarcuvitz commented 3 months ago

image

amarcuvitz commented 3 months ago

This problem may have emerged about the time I installed Copilot.

bpasero commented 3 months ago

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

amarcuvitz commented 3 months ago

Tried the latest as you requested. Problem is the same with 1.90 .

bpasero commented 3 months ago

Can you try to run code --disable-extensions --user-data-dir <directory> where <directory> is an empty folder? This will ensure Code is starting with a fresh data directory, e.g. no specific settings and without any extensions running.

amarcuvitz commented 3 months ago

It works when I do this!

In timeline, when ... is clicked in the normal versions I get different choices. (see image below) With the fresh data directory version I get just "Local History: Find entry to restore"

image

amarcuvitz commented 3 months ago

Also when I eliminate the --disable-extensions , local history works. So I assume its not the extensions. Is there some size limitation in the local saves db that would cause local saves to not be done? I have several .ipynb files that are likely big as they contain complicated bit maps.

bpasero commented 3 months ago

Yes there is settings, but they are per-file and the oldest one should get cleaned up to make room for new ones:

image

Given it works with a fresh user data dir, this issue seems specific to your setup.

bpasero commented 3 months ago

Also when I eliminate the --disable-extensions , local history works.

What does that mean exactly?

amarcuvitz commented 3 months ago

Sorry, I meant, I ran code --user-data-dir <directory> instead of code --disable-extensions --user-data-dir <directory> In both cases, local_history works fine on a fresh user data directory.

bpasero commented 3 months ago

Yeah so it is related to your user data dir. How large is the local history folder all in all for you? You can right click on an entry to open in Windows explorer.

amarcuvitz commented 3 months ago

Where do I find the user data dir ?

bpasero commented 3 months ago

image

amarcuvitz commented 3 months ago

Since Local History saves are not showing up, all I get when I right-click is: image

Is History where the local stores are accumulating? image

amarcuvitz commented 3 months ago

I also just noticed that when I open settings.json using: image the local saves appear for that Tab in the vscode Timeline.

bpasero commented 3 months ago

@amarcuvitz for me to better understand: you only have this issue with notebooks? what about a normal text file? do you see history entries then?

And btw, make sure to have history enabled from this dropdown:

image

amarcuvitz commented 3 months ago

Both .ipynb and .py files don't show local history. If I disable Git History I get: (should be showing many local changes)

image

bpasero commented 3 months ago

But .txt files do work?

amarcuvitz commented 3 months ago

No, .txt files do not show local history.

I also created a new .json file and it doesn't show local history changes in Timeline. But settings.json works fine showing changes.

bpasero commented 3 months ago

Please see if you can find any logged output that could help us find the source of the issue:

Thanks!

amarcuvitz commented 3 months ago

BTW, I really appreciate your help and hanging in with this problem. I did the following:

1. Executed `code --verbose` in CMD.  
2. Made a small edit and saved.  
3. Noted no local save showed in Timeline. 
4. From Command Palette executed `Open Logs Folder`.  
5. Exited code.

Here are the log files that seemed to me to be potentially pertinent: main.log ptyhost.log terminal.log

LMK if you want others.

bpasero commented 3 months ago

Yeah also the window.log.

amarcuvitz commented 3 months ago

From window1 subfolder:

fileWatcher.log network.log notebook.rendering.log renderer.log views.log

bpasero commented 3 months ago

What exactly is decompileFs?

amarcuvitz commented 3 months ago

Extension I was going to try but never used. I will remove and let you know if it makes a difference, however, the first test we did was with all extension disabled.

These are where I believe I did the small edit that should have produced a Timeline entry: (from "C:\Users\amarc\AppData\Roaming\Code\logs\20240605T093834\window1\fileWatcher.log")

2024-06-05 09:41:40.693 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.693 [trace] [File Watcher (node.js)] >> ignored (not included) c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.695 [trace] [File Watcher (node.js)] [raw] ["change"] Adam Web Automation.ipynb 2024-06-05 09:41:40.695 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.696 [trace] [File Watcher (node.js)] >> ignored (not included) c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.696 [trace] [File Watcher (node.js)] [raw] ["change"] Adam Web Automation.ipynb 2024-06-05 09:41:40.696 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.696 [trace] [File Watcher (node.js)] >> ignored (not included) c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.696 [trace] [File Watcher (parcel)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.696 [trace] [File Watcher (node.js)] [raw] ["change"] Adam Web Automation.ipynb 2024-06-05 09:41:40.697 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.697 [trace] [File Watcher (node.js)] >> ignored (not included) c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.750 [trace] [File Watcher (parcel)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:40.783 [trace] [File Watcher (parcel)] >> normalized [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:41.926 [trace] [File Watcher (node.js)] [raw] ["change"] Adam Web Automation.ipynb 2024-06-05 09:41:41.926 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:41.926 [trace] [File Watcher (node.js)] >> ignored (not included) c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:41.926 [trace] [File Watcher (parcel)] [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb 2024-06-05 09:41:42.016 [trace] [File Watcher (parcel)] >> normalized [CHANGED] c:\Users\amarc\OneDrive\SW_Projects\Adam Web Automation.ipynb

bpasero commented 3 months ago

So I am trying to reproduce but fail, here is me editing in a ipynb notebook:

image

I see entries appear when making changes. There is a bit of time in where we fold edits into 1 (I think 10 seconds) so you need to wait a bit before making the next edit.

Do you have anything configured in settings related to local history?

amarcuvitz commented 3 months ago

All the 5 "local timeline" settings are all reset.

here is settings.json:

{ "workbench.colorTheme": "Visual Studio Light", "security.workspace.trust.untrustedFiles": "open", "files.autoSave": "afterDelay", "editor.multiCursorModifier": "ctrlCmd", "jupyter.askForKernelRestart": false, "notebook.lineNumbers": "on", "python.analysis.autoImportCompletions": true, "python.analysis.packageIndexDepths": [

    {
        "name": "sklearn",
        "depth": 2
    },
    {
        "name": "matplotlib",
        "depth": 2
    },
    {
        "name": "scipy",
        "depth": 2
    },
    {
        "name": "django",
        "depth": 2
    }
],
"notebook.diff.ignoreMetadata": true,
"python.analysis.autoImportUserSymbols": true,
"python.analysis.completeFunctionParens": true,
"diffEditor.renderSideBySide": false,
"debug.allowBreakpointsEverywhere": true,
"[python]": {
    "editor.formatOnType": true
},
"jupyter.runStartupCommands": [],
"jupyter.debugJustMyCode": false,
"security.allowedUNCHosts": [
    "ZVSERVER"
],
"todo-tree.highlights.defaultHighlight": {

},
"python.analysis.enablePytestSupport": false,
"python.languageServer": "Pylance",
"github.copilot.editor.enableAutoCompletions": true,
"git.timeline.showUncommitted": true,
"settingsSync.ignoredSettings": [
    "workbench.localHistory.maxFileSize"
]

}

bpasero commented 3 months ago

Yeah, still no repro for me. When I hit the limit of workbench.localHistory.maxFileEntries, the list remains at that number of items, but the top one is always updated when I save.

amarcuvitz commented 3 months ago

Understand the delayed merge of 10sec. That's not it.

Ironically, "setting.json" is open in an editor throughout my testing and it updates local saves fine while I can't find any .pynb or .py file that does.

Should I take the virgin user-data folder you asked that I create back at the beginning and start to replace folders there with the folders from the problem version to see when the problem arises? If so which?

"C:\Users\amarc\OneDrive\Desktop\code_test\User\snippets"
"C:\Users\amarc\OneDrive\Desktop\code_test\User\workspaceStorage"
"C:\Users\amarc\OneDrive\Desktop\code_test\User\globalStorage"
"C:\Users\amarc\OneDrive\Desktop\code_test\User\History"
bpasero commented 3 months ago

@amarcuvitz yeah that would be great, I would start with a fresh user data folder and go in this order:

Make sure to stop VS Code from running when you make changes to the user data folder.

If we still did not find out, I can add more suggestions what to move over.

amarcuvitz commented 3 months ago

Before doing what we discussed, I noticed a folder in workspace associated with that Decompiler extension you noticed. I deleted it and I then local stores were then working again. I still find this remnant in the Editors section:

image

Any idea how to get rid of it?

amarcuvitz commented 3 months ago

I seem to have gotten rid of the remnant so I am all set.

Benjamin, I sincerely thank you for all the time you put in on this. It was a much bigger lift than I expected. 😊

bpasero commented 3 months ago

Cool, but I am still not entirely sure what happened here. How did you figure out that a folder in your workspace was associated with Decompiler extension and what extension is this? Do you have a link?

amarcuvitz commented 3 months ago

I am not completely sure. At the time I was just going through files in the explorer and workspace window to check (again) that there were no associated local saves. I was curious about why local saves worked for the setting.json file. I just remember noticing an item entitled Decompiler that I deleted along with some files that I wasn't using. Next thing I knew I saw local saves again. I wasn't expecting any of this to make a difference, I was just prepping for the experiment we were going to do.

I am confused why the first virgin user-data experiment, which had no extensions, still exhibited the problem.

I think the extension was this:

Name: Decompiler Id: tintinweb.vscode-decompiler Description: Decompile the $h*! out of things Version: 0.1.0 Publisher: tintinweb VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-decompiler

amarcuvitz commented 3 months ago

This appears to be what I did:

"C:\Users\amarc\AppData\Roaming\Code\logs\20240605T103601\sharedprocess.log"

2024-06-05 10:36:15.398 [info] Uninstalling extension from the profile: tintinweb.vscode-decompiler@0.1.0 vscode-userdata:/c%3A/Users/amarc/.vscode/extensions/extensions.json 2024-06-05 10:36:15.440 [info] Marked extension as uninstalled tintinweb.vscode-decompiler-0.1.0 2024-06-05 10:36:15.517 [error] [uncaught exception in sharedProcess]: Error: ENOENT: no such file or directory, stat 'c:\Users\amarc.vscode\extensions\extensions.json.vsctmp': EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat 'c:\Users\amarc.vscode\extensions\extensions.json.vsctmp' at a.create (c:\Users\amarc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:53:30019) at b (c:\Users\amarc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:53:30130) at t.hb (c:\Users\amarc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:58:36600) at t.stat (c:\Users\amarc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:58:29040) at async $.stat (c:\Users\amarc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:58:16186) at async J.sb (c:\Users\amarc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:104:109501) 2024-06-05 10:36:15.596 [info] Successfully uninstalled extension from the profile tintinweb.vscode-decompiler@0.1.0 vscode-userdata:/c%3A/Users/amarc/.vscode/extensions/extensions.json

Also, "C:\Users\amarc\AppData\Roaming\Code\logs\20240605T103601\userDataSync.log"

2024-06-05 10:36:03.170 [info] Using settings sync service https://vscode-sync.trafficmanager.net/ 2024-06-05 10:36:03.170 [info] Auto Sync is enabled. 2024-06-05 10:36:03.170 [info] Auto Sync: Suspended until auth token is available. 2024-06-05 10:36:03.490 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/extensions 2024-06-05 10:36:03.547 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/globalState 2024-06-05 10:36:03.611 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/keybindings 2024-06-05 10:36:03.664 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/profiles 2024-06-05 10:36:03.715 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/settings 2024-06-05 10:36:03.788 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/snippets 2024-06-05 10:36:03.871 [info] Deleting non existing profile from backup /C:/Users/amarc/AppData/Roaming/Code/User/sync/tasks 2024-06-05 10:36:04.336 [info] Auto Sync: Triggered by Interval 2024-06-05 10:36:04.336 [info] Sync started. 2024-06-05 10:36:04.699 [info] Settings: Last sync resource does not exist locally. 2024-06-05 10:36:04.786 [info] Settings: No changes found during synchronizing settings. 2024-06-05 10:36:04.788 [info] Keybindings: Last sync resource does not exist locally. 2024-06-05 10:36:04.850 [info] Keybindings: No changes found during synchronizing keybindings. 2024-06-05 10:36:04.851 [info] Snippets: Last sync resource does not exist locally. 2024-06-05 10:36:04.926 [info] Snippets: No changes found during synchronizing snippets. 2024-06-05 10:36:04.927 [info] Tasks: Last sync resource does not exist locally. 2024-06-05 10:36:05.001 [info] Tasks: No changes found during synchronizing tasks. 2024-06-05 10:36:05.003 [info] GlobalState: Last sync resource does not exist locally. 2024-06-05 10:36:05.330 [info] GlobalState: Updated remote ui state. Updated: commandPalette.mru.cache,commandPalette.mru.counter. 2024-06-05 10:36:05.333 [info] GlobalState: Updated last synchronized ui state 2024-06-05 10:36:05.335 [info] Extensions: Last sync resource does not exist locally. 2024-06-05 10:36:05.547 [info] Extensions: No changes found during synchronizing extensions. 2024-06-05 10:36:05.564 [info] Profiles: Last sync resource does not exist locally. 2024-06-05 10:36:05.632 [info] Profiles: No changes found during synchronizing profiles. 2024-06-05 10:36:05.634 [info] Sync done. Took 1299ms 2024-06-05 10:36:17.711 [info] Auto Sync: Triggered by Activity 2024-06-05 10:36:17.711 [info] Sync started. 2024-06-05 10:36:17.788 [info] Settings: No changes found during synchronizing settings. 2024-06-05 10:36:17.797 [info] Keybindings: No changes found during synchronizing keybindings. 2024-06-05 10:36:17.800 [info] Snippets: No changes found during synchronizing snippets. 2024-06-05 10:36:17.805 [info] Tasks: No changes found during synchronizing tasks. 2024-06-05 10:36:17.808 [info] GlobalState: No changes found during synchronizing ui state. 2024-06-05 10:36:17.979 [info] Extensions: Updated remote extensions. Removed: ["tintinweb.vscode-decompiler"]. 2024-06-05 10:36:17.988 [info] Extensions: Updated last synchronized extensions. 2024-06-05 10:36:17.992 [info] Profiles: No changes found during synchronizing profiles. 2024-06-05 10:36:17.995 [info] Sync done. Took 284ms

bpasero commented 3 months ago

Ok thanks, I am not sure why that would have an impact, but glad it works again.