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

What does "contents will be cleared" mean? #132

Closed
foolip opened this issue Nov 20, 2019 · 1 comment
Closed

What does "contents will be cleared" mean? #132

foolip opened this issue Nov 20, 2019 · 1 comment
Labels
Milestone

Comments

@foolip
Copy link
Member

foolip commented Nov 20, 2019

For chooseFileSystemEntries() there's non-normative text that says:

When set to "save-file" the dialog will additionally let the user select files that don’t yet exist, and if the user selects a file that does exist already, its contents will be cleared before the handle is returned to the website.

What does clearing entail? Will the file be of length zero even if the site then doesn't write anything to it? That seems problematic, resulting in data loss if the site fails to reach the close() call.

This seems to me like a case for write-only handles, in which case the content wouldn't need to be cleared.

@mkruisselbrink
Copy link
Contributor

I'm not sure why that is problematic? Yes, if you have buggy websites you might have data-loss, but that wouldn't be that much different if we didn't clear the file until the websites tells us to. I.e. a website that reaches close() to soon would cause the same data loss in either case... Both cases the user asked a website to nuke a file and replace it with whatever data the website wants to replace it with, so from the users point of view this doesn't seem to make any difference?

@mkruisselbrink mkruisselbrink added this to the V1 milestone Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants