oleg-shilo / Favorites.vscode

VSCode extension for managing Favorites
MIT License
23 stars 6 forks source link

The workspace folder gets deleted on renaming of the favorite list #26

Closed oleg-shilo closed 2 years ago

oleg-shilo commented 2 years ago

jan Savli commented: What the hell?!! This extension just deleted my whole project folder?!... https://marketplace.visualstudio.com/items?itemName=oleg-shilo.favorites&ssr=false#review-details

Extra info is needed:

chavlji commented 2 years ago

I'm jan savli.

I've managed to reproduce it:

Not exactly what I've claimed at first, but definitelly very dangerous act...

chavlji commented 2 years ago

I've updated my review. Otherwise, I quite like your extension. It saves me quite some time. I appreciate your effort!

oleg-shilo commented 2 years ago

Thank you, I also appreciate your willingness to assist. I know it's not easy when you feel frustrated because of the perspective of losing your code.

I am glad you have recovered it and now I have your detailed description so I am in a good position to fix it.

Txs

oleg-shilo commented 2 years ago

Perfect. I can reproduce the problem

oleg-shilo commented 2 years ago

Indeed it was a problem. The renaming operation is only intended for the lists themselves but not for the list items. In your scenario, that item was a folder and as a result, that folder was renamed, like it was a file.

The mistake is corrected in v1.5.6. Now, this operation is prohibited for list items and the corresponding error message is displayed.

May I ask you a favour? Can you please test the fix by downloading it from https://github.com/oleg-shilo/Favorites.vscode/releases/tag/v1.5.6 and installing manually? I would like to publish it in VSCode Marketplace only when I am sure it fully addresses the issue.

. . .

Interestingly enough fs.renameSync transparently renames any file system object (a file or a foder), while other languages (e.g. C#) would throw the exception as they have separate dedicated API for renaming folders and files.

oleg-shilo commented 2 years ago

Decided to publish (on marketplace) the fix right away. Considering the impact of the defect, don't want to delay.

So please install/update the latest release v1.5.6 it from VSCode directly. https://marketplace.visualstudio.com/items?itemName=oleg-shilo.favorites

chavlji commented 2 years ago

Hi! It did the trick! I'm unable to rename folders/files now. I've updated my review. I've tried to make a small donation (aka a beer ;)), but the Donate button returns 404 :D

oleg-shilo commented 2 years ago

Gread. So happy with the quick turn around. It would not be possible without your strong cooperation. Really appreciate. Have also update my review response to reflect that.

Re donation button. That's rather embarrassing image

The donation disclamer page web hosting has been changed but I failed to update the link on all products/projects that I maintain. Fixed now.

Have a nice day.