Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing to a read-only file succeeds falsely #282

Closed
CCing17 opened this issue Aug 19, 2021 · 9 comments
Closed

Writing to a read-only file succeeds falsely #282

CCing17 opened this issue Aug 19, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@CCing17
Copy link

CCing17 commented Aug 19, 2021

When writing to a read-only file and save, the save action "succeeds" (while the remote file is actually not updated) without any pop-up message, which was there previously.

Output log has (exact file path obfuscated):

[DEBUG]   Writing 85652 bytes to ssh://vm/home/[...]
[ERROR]   Error handling uri: ssh://vm/home/[...]
[ERROR]   Permission denied
JSON: {"code":3,"lang":""}
Error: Permission denied
	at k._transform (/Users/[...]/.vscode/extensions/kelvin.vscode-sshfs-1.21.2/dist/262.extension.js:1:82627)
	at k.Transform._read (internal/streams/transform.js:205:10)
	at k._read (/Users/[...]/.vscode/extensions/kelvin.vscode-sshfs-1.21.2/dist/262.extension.js:1:78632)
	at k.Transform._write (internal/streams/transform.js:193:12)
Logged at:
	at z.<anonymous> (/Users/[...]/.vscode/extensions/kelvin.vscode-sshfs-1.21.2/dist/398.extension.js:1:2827)
[DEBUG]   Error converted to: NoPermissions (FileSystemError): ssh://vm/home/[...]

It used be the case that the save action would not succeed and a pop-up message would show up about the permission issue.

@SchoofsKelvin
Copy link
Owner

Since when did this start happening? Your error log shows the extension is still throwing the correct order, so my first guess is that VS Code changes something in an update.

@SchoofsKelvin SchoofsKelvin added bug Something isn't working waiting Waiting for confirmation, more information, ... labels Aug 19, 2021
@CCing17
Copy link
Author

CCing17 commented Aug 19, 2021

It has been like this for a while (a few months?). I can try to revert back to a previous version of VS Code to find out the exact update that breaks this. But is this going to be a VS Code issue, or can the extension still do something about it?

@SchoofsKelvin
Copy link
Owner

It sounds to me like it's something that VS Code changed.

Worst case, if they did indeed remove that feature, I can add it myself, since extensions can also create notifications.

@CCing17
Copy link
Author

CCing17 commented Aug 23, 2021

It seems this started to not work in April's release (version 1.56). The March release was still functioning properly.

@SchoofsKelvin
Copy link
Owner

I did notice some code changes in VS Code going from 1.55.2 to 1.56.0, although that was just after taking a very quick glance at over thousands of file changes. I'll see if I can pinpoint the exact cause and report it to VS Code. Otherwise I'll add a config flag to make the extension explicitly notify the user when write operations fail for some reason.

@SchoofsKelvin SchoofsKelvin removed the waiting Waiting for confirmation, more information, ... label Sep 1, 2021
@trenutoo
Copy link

I can confirm this issue persists on 1.61.0

@SchoofsKelvin
Copy link
Owner

I'll look into this again, seeing if this is an issue reported on the VS Code repository. Otherwise I'll (add an option to) make it show a notification when writing to a file fails instead of letting (only) VS Code handle the error reporting.

@MrMuzzio
Copy link

MrMuzzio commented Feb 4, 2022

I can confirm it's still an issue on version 1.63.2. If you don't have permission to write on the file, you will lose your work without noticing it (like me 😢)

@SchoofsKelvin
Copy link
Owner

Fixed in cac0ec2, which'll be in the next version (1.24.2 or later) of the extension.

The extension now by default shows an error notification (a non-modal one in the bottom right) whenever a file system operation fails, with the exception of NotFound errors for ignored paths. The extension has a few NotFound ignored paths hardcoded, such as .vscode/settings.json, since VS Code (or extensions) always try to read them.

The feature is actually hidden behind the FS_NOTIFY_ERRORS flag (see #270), but is auto-enabled for VS Code 1.56.0+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants