[w3ctag/design-reviews] Multiple Readers and Writers in File System Access API (Issue #845)

こんにちは TAG-さん!

I'm requesting a TAG review of Multiple Readers and Writers in File System Access API.

Currently, only one [`FileSystemSyncAccessHandle`](https://fs.spec.whatwg.org/#api-filesystemsyncaccesshandle) may be open at a time per file, preventing an origin from reading the same file from multiple tabs easily. Conversely, multiple [`FileSystemWritableFileStream`](https://fs.spec.whatwg.org/#filesystemwritablefilestream) can be simultaneously open, letting multiple writers clobber each other.

Introducing new “create” modes for `FileSystemSyncAccessHandle` and `FileSystemWritableFileStream` allows opening either multiple readers/writers or an exclusive writer to a file entry, depending on the application's use case.

```
handle.createSyncAccessHandle({ mode: 'read-only' });
handle.createWritable({ mode: ‘exclusive’ });
```

  - Explainer: https://github.com/whatwg/fs/blob/main/proposals/MultipleReadersWriters.md
  - Security and Privacy self-review: No changes introduced to the existing review ([WICG/file-system-access/security-privacy-questionnaire.md](https://github.com/WICG/file-system-access/blob/main/security-privacy-questionnaire.md))
  - GitHub repo: [whatwg/fs](https://github.com/whatwg/fs/)
  - Primary contacts:
      - Austin Sullivan (@a-sully), Google Chrome
      - Daseul Lee (@dslee414), Google Chrome
  - Organization/project driving the design: Google/Chromium
  - External status/issue trackers for this feature: https://bugs.chromium.org/p/chromium/issues/detail?id=1382215

Further details:

  - [x] I have reviewed the TAG's [Web Platform Design Principles](https://www.w3.org/TR/design-principles/)
  - The group where the incubation/design work on this is being done: [whatwg/fs](https://github.com/whatwg/fs/) and [WICG/file-system-access](https://github.com/WICG/file-system-access)
  - The group where standardization of this work is intended to be done: [whatwg/fs](https://github.com/whatwg/fs/)
  - Existing major pieces of multi-stakeholder review or discussion of this design: https://github.com/whatwg/fs/issues/34
  - Major unresolved issues with or opposition to this design: Webkit is positive in regards to allowing multiple read-only `FileSystemSyncAccessHandle`s, but the stance for multiple writers is not yet known.
  - This work is being funded by: Google

You should also know that…

- `FileSystemSyncAccessHandle` is available only on Bucket File System (a.k.a. [Origin Private File System](https://fs.spec.whatwg.org/#sandboxed-filesystem)), while `FileSystemWritableFileStream` is available on both Bucket File System (implemented in Blink, Gecko, WebKit) and local file system (Chromium-only).
- We think that adding an optional dictionary is probably not controversial, and adding modes like shared read-only, exclusive readwrite, and (unsafe) shared readwrite are common across native file system APIs, but feedback on the specific enum strings would be especially welcome.
- Also, we think that preventing modification of a parent directory via shared lock would be desired, as a file entry is represented by a file path; however, native file system behavior on this varies, and feedback on this is welcome.

We'd prefer the TAG provide feedback as:

  🐛 open issues in our GitHub repo for **each point of feedback**

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/845
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/845@github.com>

Received on Thursday, 18 May 2023 18:03:25 UTC