microsoft / vscode

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

Unable to re-use name of computer deleted from settings sync #141663

Open Kytech opened 2 years ago

Kytech commented 2 years ago

Issue Type: Bug

If I remove a computer from the list of machines that have settings sync enabled, I cannot rename another computer to the name of the computer that was just removed. This issue also occurs on the latest insiders build.

Steps to Reproduce (The placeholder names of my-computer and my-work-computer can be substituted with any names):

  1. Enable settings sync on multiple computers with VSCode
  2. From one of the computers, open the panel shown by the Settings Sync: Show Synced Data command (or by clicking the "settings sync is on" message in the account menu in the sidebar) and rename the current computer to my-work-computer or some other friendly name.
  3. From the same panel, rename the other computer to my-computer or a different name.
  4. Switch to the other computer (the one named my-computer in this example). Make sure settings sync has pulled the lastest data and the friendly names for both computers show up in the Show Synced Data panel.
  5. Delete the computer named my-work-computer (The computer that is not marked as current/the one we were last using)
  6. Attempt to rename the current computer from my-computer to the same name that the computer we just deleted had (in this example, my-work-computer)
  7. VSCode displays a message stating that machine names must be unique, even though a computer with the name my-work-computer no longer exists in the list of computers that have settings sync enabled.

VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:40:02.816Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.92GB (7.47GB free)| |Process Argv|--disable-extensions --crash-reporter-id bd59afe9-92b3-4cc3-aa1f-8080f56363f7| |Screen Reader|no| |VM|0%|
Extensions disabled ------------------------- Screenshot of issue: In this case, the name of the computer I previously deleted was called `Kytech-Surface`. It does not show in the list of machines with settings sync enabled as it has been deleted. Attempting to rename any of the computers with settings sync to the old name produces the same issue: ![image](https://user-images.githubusercontent.com/2079386/151424906-d78b38ae-d5b8-4cd4-a158-e25a6051e6a2.png)
resignationinfinite commented 1 year ago

Confirmed this is still an issue.

conioh commented 1 year ago

And there's no tool to delete this phantom machine. And there's no tool to even show the currently occupied names (even though the VSCode client obviously knows them).

I wonder if by this issue's one year anniversary we'd get any kind of acknowledgement from Microsoft, never mind a fix...

Kytech commented 1 year ago

And there's no tool to delete this phantom machine. And there's no tool to even show the currently occupied names (even though the VSCode client obviously knows them).

I wonder if by this issue's one year anniversary we'd get any kind of acknowledgement from Microsoft, never mind a fix...

Yeah, it would be nice to have this acknowledged. If I ever reinstall my OS without de-registering the computer from settings sync first, I'll run into this issue again and have to get creative with how I rename computers in VSCode since I always keep the same device/hostname whenever I do a clean install (or replace the device with another).

conioh commented 1 year ago

Happy late anniversary!

Longhanks commented 1 year ago

I recently had the same issue. I was able to remove the phantom machine by deactivating settings sync, which prompts "do you also want to delete all cloud data?", which I approved. Then, I reenabled settings sync, and no more machines were shown in the Show Synced Data panel. Finally, I renamed my machine to the previously occupied phantom name, and that now worked flawlessly.

conioh commented 5 months ago

Another year has passed.

Kytech commented 5 months ago

Yep, and the bug is still floating around. Tried to re-use a name affected by this near the end of 2023 and still am experiencing the same problem - that name is still giving me the same error it did when I first opened this issue.

I can re-confirm as of about a week ago that the problem does not occur if you turn off settings sync on a machine. Looks like that process cleanly de-registers the machine name, in contrast to how deleting a machine from another computer does not cleanly de-register that machine name, resulting in this bug.

This doesn't seem like it would be too difficult of a fix, and I'd be happy to contribute towards a solution, but since settings sync is largely a server-driven feature, I wouldn't be surprised if the cause of the issue is on the server-side and wouldn't be something that could be fixed with a PR to this repo.

songzy12 commented 1 month ago

+1 still an issue

fearnliu commented 4 weeks ago

me too, current is 2024 year 10 month