microsoft / vscode

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

Cloud Changes causes data loss. Should notify before applying changes. #198460

Open jasonswearingen opened 12 months ago

jasonswearingen commented 12 months ago

sorry not a real bug report, as I don't know how to repro, but a FYI.

the problem:

cloud changes caused dataloss because it restored stale data

the setup:

the steps?

  1. had the above vscode windows open
  2. make changes in VS (not vscode), commit to repo (using the "Fork" Git Client).
  3. make some additional changes using VS as client.
  4. reboot my computer (iirc, this will cause VSCode to store cloud changes)
  5. open VS, see my (pending) changes
  6. open a VSCode window (parent folder of .sln) and suddenly all my edits are blown away, files are in a state prior to last git commit.

additional thoughts

joyceerhl commented 11 months ago

Sorry for the trouble and thanks for reporting.

prompt the user to restore cloud changes

This is strange. We notify if we detect that resuming changes would overwrite local changes. We also don't resume stale changes if they were generated for an unrelated commit (there is an experimental setting which will notify you if there are stored changes which have a different commit but same ref and repo). Can you share your settings just in case?

jasonswearingen commented 11 months ago

Here are my settings (from appData). I don't use per-folder/project settings. IIRC the last thing I did was disable the cloud changes. settings.json

If it matters, I tend to have many different VSCode windows open, for example: one for the git repo root, one for the .csproj root, and maybe another one-off editing some random file somewhere on the HD.