Support co-located VFS providers and request-scoped operations - #96
Open
DeBaschdi wants to merge 4 commits into
Open
Support co-located VFS providers and request-scoped operations#96DeBaschdi wants to merge 4 commits into
DeBaschdi wants to merge 4 commits into
Conversation
A WebExtension can implement a storage provider and consume it from the same add-on. Register the provider explicitly in the client session and use a local background port while picker pages continue through the runtime port handler.
Provider setup waits for the consumer response before returning a storage reference. Return the client session write promises so that response means the new or removed connection is already reflected in the picker state.
Command payloads are caller-controlled and cannot establish identity. Derive the consumer ID from the runtime port, require the exact consumer and storage pair for commands and change events, and bind one-time setup approval to the port that requested it.
The existing abort API cancels every pending request for a provider. Pass AbortSignal through read, list, and picker operations, keep request ownership on its runtime port, and close only the matching picker so independent work can continue.
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.
Summary
Why
The toolkit currently discovers only other extensions, so an add-on cannot expose a provider and consume it through the same VFS API.
Provider setup can also return before the picker cache contains the new connection. Caller-provided IDs must not establish identity, and provider-wide cancellation can interrupt unrelated operations.
Compatibility
The API version and existing operation payloads remain unchanged.
Existing external providers continue to work with the updated client. The provider still accepts the original API 1.3 cancel message without its own request ID, so older clients remain compatible. New clients add a request ID only for correlation and request ownership.
Co-located provider support is opt-in through
registerLocalProvider().Verification