Require an exclusive lock in removeEntry()#73
Draft
a-sully wants to merge 1 commit intowhatwg:mainfrom
Draft
Conversation
a-sully
commented
Nov 2, 2022
| reject |result| with a {{NotAllowedError}} and abort. | ||
|
|
||
| 1. Let |lockResult| be the result of [=file entry/lock/take|taking a lock=] | ||
| with "`exclusive`" on |entry|. |
Collaborator
Author
There was a problem hiding this comment.
Note: we need to ensure that the new locking paradigm covers locked directories appropriately - we should not be able to remove a directory if any contained files are locked, but presumably moving a directory with contained files that are locked is okay
Collaborator
Author
|
Update: This PR is also incorrect as written, since the lock should not be on the directory itself but on the child being removed. I'll update that before sending for review... Anyways, I filed #138 to track updating updating the spec both for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For the sake of backwards compatibility,
removeEntry()currently only requires acquiring a shared lock in Chromium (though this is not specified). This means that you cannot remove a file with an open Access Handle, but you can remove a file with an openWritableFileStream. See #34 (comment) for context.The
removeEntry()method should take an exclusive lock, matching #9. At least until we change the locking paradigm to not be based on "exclusive" and "shared" locks in #34.remove()in Request for multiple readers via access handles #34(See WHATWG Working Mode: Changes for more details.)
Preview | Diff