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

Update non-normative text for DirectoryHandle's removeEntry() #166

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rahulsingh-msft
Copy link

@rahulsingh-msft rahulsingh-msft commented Dec 19, 2024

This change updates only the non-normative section for
FileSystemDirectoryHandle's removeEntry() method.

It clarifies that the Promise is rejected with a "NotFoundError"
DOMException when an entry corresponding to the name parameter does
not exist.

Further, it adds that the Promise is rejected with an
"InvalidModificationError" DOMException when attempting to remove a
non-empty directory with the recursive option set to false.

These updates were made to align the non-normative text with the
algorithm for removeEntry() outlined in the File System Standard.
See here: https://fs.spec.whatwg.org/#api-filesystemdirectoryhandle-removeentry


Preview | Diff

@annevk
Copy link
Member

annevk commented Dec 19, 2024

@rahulsingh-msft you need to work with someone at Microsoft (possibly @diekus) to get https://github.com/whatwg/participant-data updated as Microsoft currently hasn't signed up for the Storage Workstream (see also https://whatwg.org/workstreams).


: await |directoryHandle| . {{FileSystemDirectoryHandle/removeEntry()|removeEntry}}(|name|, { {{FileSystemRemoveOptions/recursive}}: true })
:: Removes the [=/file system entry=] named |name| in the [=directory entry=]
[=locate an entry|locatable=] by |directoryHandle|'s [=FileSystemHandle/locator=].
If that entry is a directory, its contents will also be deleted recursively.

Attempting to delete a file or directory that does not exist is considered success.
Attempting to delete a file or directory that does not exist results in a promise
being rejected with a "NotFoundError" DOMException.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to presuppose an outcome to #11. The normative text doesn't seem to currently reject at all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking a first look @annevk! I'll pick this back up after the holidays. Will work with @diekus to get the Participant Data updated in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants