Skip to content

Origin Private File System – identification of buckets (similarly to FAS API showSaveFilePicker) #155

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

Closed
projektorius96 opened this issue Jan 18, 2024 · 3 comments

Comments

@projektorius96
Copy link

What is the issue with the File System Standard?

As titled.

This is also related to my detailed question on issue:web-platform-tests/interop#172 (comment)

Perhaps I am from those very few web developers that read specifications, but just to clarify: Does the specification describes means for identification of bucket(s) per origin ?

Cheers ♥

@a-sully
Copy link
Collaborator

a-sully commented Jan 18, 2024

From your response on the other issue:

Consider I have a local developer server established on localhost:5500 that I had been served files from directory A during session one (let's call it – SESS_ONE), but 5 minutes later I served different files from directory B on the same origin of localhost:5500, yet as a new session (let's call it – SESS_TWO).

My question is as follows: Does OPFS override (should I say overwrite?) the data saved during SESS_ONE the files served from directory A in favour of directory B persistence during new re-established SESS_TWO ? As far as I do understand OPFS provides a single bucket per origin, unless those buckets are IDed internally, otherwise OPFS is what says "per origin" and that specific origin should be reserved for particular directory N? Could you elaborate a bit further on, please . I tried to dig into specification, but could not find much about it. Plus we all know that depending on user-agent vendors the implementation can slightly differ. To underline, I am particularly interested in cases of Chrome / Microsoft Edge .

For starters, the spec doesn't mention "OPFS" because there may be more than one file system per origin. See #92

The question of whether or not you'll get the same file system instance in SESS_ONE and SESS_TWO has the same answer as whether or not you'll get the same IndexedDB instance. Which is a hint that you're looking in the wrong spec :)

The FS spec specifies the algorithm for getDirectory(). A local storage bottle map is obtained in Step 2. (What the heck is a Storage Bottle? See https://storage.spec.whatwg.org/#model) Where that local storage bottle map comes from is defined by the Storage spec

@a-sully
Copy link
Collaborator

a-sully commented Jan 18, 2024

Does OPFS override (should I say overwrite?) the data

Can't you inspect the data in the OPFS (say, using https://github.com/tomayac/opfs-explorer/) at the start of SESS_TWO to check whether it contains any data?

@a-sully a-sully closed this as completed Jan 18, 2024
@projektorius96
Copy link
Author

Does OPFS override (should I say overwrite?) the data

Can't you inspect the data in the OPFS (say, using https://github.com/tomayac/opfs-explorer/) at the start of SESS_TWO to check whether it contains any data?

Yes, technically I can perform a use-case and see the behaviour deductively.

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

No branches or pull requests

2 participants