Issue Type: Bug
After clicking "Restart to Update" VSCode restarted correctly, but upon reviewing my open files, I had two unsaved files I was working on. They were untitled 4 and 5. The tabs reappeared, but there was no text inside the files.
VS Code version: Code 1.32.0 (507312a3e3b34b084b467dfd983263bc7c9d87e0, 2019-03-06T18:57:55.589Z)
OS version: Windows_NT x64 10.0.17134
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled|
|Memory (System)|15.85GB (8.15GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
Extensions (6)
Extension|Author (truncated)|Version
---|---|---
xml|Dot|2.4.0
gitlens|eam|9.5.1
json-tools|eri|1.0.2
VBScript|lug|0.0.2
csharp|ms-|1.17.1
PowerShell|ms-|1.11.0
I've just encountered this same problem. Very frustrating that I lost the text in my unsaved files after performing the upgrade to the new version!
The irony is that up until now it's been safer to keep files that I'm actively working on in an unsaved state. Because there's a separate issue whereby VS Code doesn't restore any saved files when opening it by double-clicking a file in File Explorer. You can read more about that here: https://github.com/Microsoft/vscode/issues/14675. Unfortunately session persistence/integrity appears to be very low priority for the VS Code development team, as that issue (and several duplicates posted by several different people) has received no attention.
So now it appears that whether you keep the files you're currently working on saved or unsaved, VS Code cannot be relied on to restore your session correctly either way.
Also, when opening VS Code when it has tabs with unsaved files, two instances of VS Code are opened. And then between the two of them, they get very confused about what is saved and what isn't. Something is very broken in v1.32.0. It's curious that none of the Insiders noticed this very obvious problem.
There's indeed something rotten with this version. I hope for a quick fix. I've lost few unsaved files upon update to latest version.
I've returned to 1.31.1 and disabled automatic updates for now. Hopefully it will get fixed soon.
Same here. I've also downgraded to 1.31.1 and disabled automatic updates.
If you have not closed the window of 1.32.0 yet, you should be able to recover the untitled files by looking inside the .../Code/Backups
path (platform paths here).
If you have not closed the window of 1.32.0 yet, you should be able to recover the untitled files by looking inside the
.../Code/Backups
path (platform paths here).
For me it was .../Code/Backups/GUID/untitled, but it worked. I was able to pull the text. Thanks for that.
In my case I unfortunately did close the window. Now the backup folder contains only currently open files of the downgraded version, not the ones I lost during the update. :(
I had already closed the window of 1.32.0 but I was able to restore the Backups folder from a daily full system backup that had run a few hours prior, so I was able to get back the text that way.
I had already closed the window of 1.32.0 but I was able to restore the Backups folder from a daily full system backup that had run a few hours prior, so I was able to get back the text that way.
Actually it's a good idea. But I've recently migrated to a new MBP and have not set-up Time Machine yet. Although a bit older version of few files I was able to recover from my previous machine. So not everything is lost. 馃憤
Here is how I got to the older version: https://code.visualstudio.com/updates/v1_31 - download links at the top.
I'm going to have to restore from backup to try and get my old folder though, I launched the new VS Code and I guess I needed to do something other than what I did to get it all back?
Using Time Machine to restore the path:
/Users/MY_USERNAME/Library/Application Support/Code/Backups
Then relaunching the old version (which I have set not to auto-update as per: https://code.visualstudio.com/docs/supporting/faq#_how-do-i-opt-out-of-vs-code-autoupdates ) - that worked. So far, so good. my windows are all weirdly resized, but, whatever.
@roblourens Do you know if anybody is going to look at https://github.com/Microsoft/vscode/issues/14675 ?
@bpasero unassigned himself from that issue back in 2016, presumably thinking someone else would step up to the plate. But unfortunately, nobody else has ever stepped up to the plate on that one, and to this day it is still unresolved and it is still a major pain.
Verified on macOS.
Out of interest, was a full smoke test ever performed on v1.32.0 before it was released to the public?
I see that the Smoke Test page ( https://github.com/Microsoft/vscode/wiki/Smoke-Test ), which was last updated in 2018, contains the following set of tests:
Data Loss
Verify the following both with dirty files and untitled files
Make sure you get asked and can save when closing the editor itself
Make sure you get asked and can save when closing from Opened Editors view
Mac only: Make sure you get asked and can save on window close
Make sure that when you file > quit and reopen, dirty files and untitled restore properly ("hot exit")
The smoke test(s) would only apply to normal operation and not to 'restart to update', I think. The 'restart to update' is different than close/exit. I never noticed this bug during updates to Insiders, but I will have to look, I might not have any untitled files open in my Insiders instance.
Same problem here. Lost some important info (admittedly left on an unsaved buffer). 馃槩
@takanuva, if you read through this post, you can probably find the lost data in the backup folder. It seems not to overwrite them, as I found mine still there after several open/close cycles.
@msftrncs, already tried that. Sadly, too late for me. Files were deleted from that folder (as I had already restarted the editor before finding this issue).
Interesting, as mine are still there, after several more times of closing the editor, even after restoring the contents, the old backups remain. Had you closed the unsaved tabs? Closing them might cause the deletion of the files.
Yeah, I think I did that. I tried a few things while looking for the missing buffers. I'll assume it's my fault... 馃槥
is there any method that restore the missing content?
is there any method that restore the missing content?
https://github.com/Microsoft/vscode/issues/69972#issuecomment-470706961
On my second machine, I got the 1.32.1 update, and I did not lose any unsaved untitled editor's contents this time, but I had saved the important ones just to make sure.
I lost unsaved files as well as unsaved changes to saved files because of some bug with the changelog tab it seems 馃槨
Order of Events:
%appdata%\Code\Backups
there is only workspaces.json
, but no auto-saved filesI am pretty sure that I encountered odd behavior immediately after auto-updates before, with two windows opening with the changelog tab open in both, and also some other tabs present in both windows. However, I did not lose unsaved changes like that before.
Still not completely fixed by 1.32.1. On restarting all unsaved files are doubled to a new window. When you close one of the duplicate windows then upon next app restart the unsaved files are lost again.
I'm returning to 1.31.1 again until this one also gets fixed. Sadly. :(
Not saying anyone deserves this to happen but reading some of these comments about losing important data in unsaved tabs is giving me anxiety. Save early save often, folks.
EDIT: I kind of regret making this comment, it's off-topic and comes off as a bit condescending.
_Not saying anyone deserves this to happen_ but reading some of these comments about losing important data in unsaved tabs is giving me anxiety. Save early save often, folks.
I am sorry, but you are wrong. In matter of fact these files are "saved", but only to the app's directory (they are only marked as "unsaved" in UI because you didn't give them a name yet). But unfortunately the mechanism for this got broken with last update.
And since this is the app's official feature, you can't justify losing something by telling us that it is unreasonable to use this feature.
For all the people that are going back to v1.31.1
-> I think that I had the same problem on previous month update - that is why this time I went through all unsaved files before updating ;-)
_Not saying anyone deserves this to happen_ but reading some of these comments about losing important data in unsaved tabs is giving me anxiety. Save early save often, folks.
Amen. But I use it as scratchpad for random things, and for that it is super convenient to just hit Ctrl+N and note down things, without having to give it a title. It's similar to how I use browser tabs: it's a low priority reminder to read or do something.
Still not completely fixed by 1.32.1. On restarting all unsaved files are doubled to a new window. When you close one of the duplicate windows then upon next app restart the unsaved files are lost again.
I'm returning to 1.31.1 again until this one also gets fixed. Sadly. :(
Seeing the same thing, and also doing the same thing, going back to 1.31.1. This probably shouldn't be marked as closed.
Seeing the same thing, and also doing the same thing, going back to 1.31.1. This probably shouldn't be marked as closed.
Updating to or from 1.32.0 will cause the issue due to the way that untitled files were being saved behind the scenes. So it makes sense if you saw it when updating 1.32.0->1.32.1 as well, the issue is definitely fixed though. We considered making a change to support both the correct and broken 1.32.0 ways, but it would have been too risky of a change. See https://github.com/Microsoft/vscode/pull/69999#issuecomment-470744110
Seeing the same thing, and also doing the same thing, going back to 1.31.1. This probably shouldn't be marked as closed.
Updating to or from 1.32.0 will cause the issue due to the way that untitled files were being saved behind the scenes. So it makes sense if you saw it when updating 1.32.0->1.32.1 as well, the issue is definitely fixed though. We considered making a change to support both the correct and broken 1.32.0 ways, but it would have been too risky of a change. See #69999 (comment)
Are you sure? I am certain that I updated from previously downgraded 1.31.1 to 1.32.1 (wanted to test the fix) and described problem was present.
Seeing the same thing, and also doing the same thing, going back to 1.31.1. This probably shouldn't be marked as closed.
Updating to or from 1.32.0 will cause the issue due to the way that untitled files were being saved behind the scenes. So it makes sense if you saw it when updating 1.32.0->1.32.1 as well, the issue is definitely fixed though.
Alright, I'll stick with 1.32.1 for now and do some more testing. But, you'll hopefully forgive me if I'm a bit nervous about possibly losing another couple of documents, and intend to only rely on unsaved documents for non-critical work for a couple of weeks until I'm comfortable/confident that I haven't seen any other related issues.
If the series of events matters to anyone, I had already lost a couple of documents with the 1.32.0 update. After that I updated to 1.32.1, created two new untitled files, (trusted that the problem was fixed, so...) closed without saving, and shut down. I booted back up this morning, opened Code, and the double window thing happened. I hit the close button on one of them, was prompted to save the documents, and warned that if I didn't save I'd lose my changes. (And since I hadn't changed anything, I interpreted the warning as losing all the contents in both documents.) So, I saved them, and then came here to read through the thread again because I had recalled someone mentioning still having trouble with this. That's when the double window thing registered in my head. (I had missed/overlooked that comment yesterday, but having seen it provided the context I needed.) If you say the behavior I saw was expected, and going forward things should be as they were before, I'll go with that.
Since reading your comment stating "_the issue is definitely fixed_," I've created a couple of documents using 1.32.1, closed without saving, and reopened Code. I have not seen double windows nor lost document contents, so it does appear to be working properly.
Seeing the same thing, and also doing the same thing, going back to 1.31.1.
Alright, I'll stick with 1.32.1 for now and do some more testing.
Since reading your comment stating "_the issue is definitely fixed_," I've created a couple of documents using 1.32.1, closed without saving, and reopened Code. I have not seen double windows nor lost document contents, so it does appear to be working properly.
Sadly, I must take back my latest statements. Two windows open every time I open Code, one in the last position used, and one centered on the screen. Attempting to close the center window results in a prompt to save my files, and when I agree to do so, the save state does not extend to the remaining open window.
I will say I've not actually lost any file contents, so _the original problem does appear to be resolved_. But, the double window / prompts to save / different save states in different windows convinced me to revert to 1.31.1. Unfortunately, despite changing the auto update setting, it keeps auto updating to 1.32.1. Tried three times now with the same result. I will take the advice above, save early, save often, and close my files before closing Code.
@brianamm Sorry for your bad experience. If you want to stick to 1.31.1 until we solve the double window problem, you can use "update.mode": "none"
for now.
@brianamm Sorry for your bad experience. If you want to stick to 1.31.1 until we solve the double window problem, you can use
"update.mode": "none"
for now.
@brianamm I'll just add that on 1.31 branch you'd also probably need "update.channel": "none"
to disable automatic updates.
If you want to stick to 1.31.1 until we solve the double window problem, you can use
"update.mode": "none"
for now.
I'll just add that on 1.31 branch you'd also probably need "update.channel": "none" to disable automatic updates.
Thank you @octref and @MartinZubek . That was the problem, update.mode
had no effect. However, update.channel
did the trick. All is good now.
Two windows open every time I open Code, one in the last position used, and one centered on the screen.
@brianamm that one's fixed already and should by in 1.32.2 https://github.com/Microsoft/vscode/issues/70006
But, you'll hopefully forgive me if I'm a bit nervous about possibly losing another couple of documents, and intend to only rely on unsaved documents for non-critical work for a couple of weeks until I'm comfortable/confident that I haven't seen any other related issues.
Understandable, this slipped through due to a hole in our testing and we intend to remedy it with the following:
I'll continue to use untitled files as my scratchpad but I would definitely recommend saving anything important just in case. I do this anyway as I have "files.hotExit": "onExitAndWindowClose"
set so I may forget which folder had which notes.
Updating to or from 1.32.0 will cause the issue due to the way that untitled files were being saved behind the scenes. So it makes sense if you saw it when updating 1.32.0->1.32.1 as well, the issue is definitely fixed though. We considered making a change to support both the correct and broken 1.32.0 ways, but it would have been too risky of a change. See #69999 (comment)
@Tyriar, this highlights another issue. I updated today from 1.31.1 and was bit by this, even though it's fixed in 1.32.1, because the update went to 1.32.0. VS Code is now telling me I can restart and update to 1.32.1.
Shouldn't updates go to the latest minor version? By updating to 1.32.0 instead of 1.32.1 I was bit by a bug that was already fixed.
I've just had the same experience as @dsanders11 and was upgraded to 1.32.0. 馃敟 馃槨
Can we fix or stop the upgrade pipeline @roblourens? I'm pretty gutted and can't be the only one.
Sorry @seanpoulter. We've already released 1.32.1 but if the 1.32.0 update is downloaded first, it won't install 1.32.1 in the background. So anyone who's computer downloaded 1.32.0 before we froze it and released .1 will have to upgrade through it. Sorry about that, we will be looking into this in the future.
Just updated to 1.32.2 and everything seems to be working fine again.
Hopefully it will stay this way for a while.
I'm experiencing the same issue now. Upgraded to 1.32.2 and all the unsaved files i had just disappeared. The issue is definitely NOT fixed.
You're not alone, @seanpoulter. This is pretty frustrating indeed. :disappointed:
I found my files using @willprather's solution:
You should be able to recover the untitled files by looking inside the
.../Code/Backups
path (platform paths here).
That means you'd find your files Backups in these folders:
%APPDATA%\Code\Backups
$HOME/Library/Application Support/Code/Backups
$HOME/.config/Code/Backups
Good luck @takanuva! 馃
It just happened to me, with version 1.32.1.
No need to mention I'm very upset right now, lost 8 files.
%APPDATA%\Code\Backups only contains a 1kb workspaces.json file, but not my data.
I've always used this feature in both notepad++ and VSCode, but despite being developed by only one guy, notepad++ never destroyed any of my content...
i think it's time to go back to Sublime Text or Atom. I understand UI glitches, but when VSCode is losing data, that's where I draw the line.
Most helpful comment
Not saying anyone deserves this to happen but reading some of these comments about losing important data in unsaved tabs is giving me anxiety. Save early save often, folks.
EDIT: I kind of regret making this comment, it's off-topic and comes off as a bit condescending.