Add bounded native workspace byte reads - #75
Draft
MiguelsPizza wants to merge 1 commit into
Draft
MiguelsPizza wants to merge 1 commit into
MiguelsPizza wants to merge 1 commit into
Conversation
Expose an optional range capability so consumers can request a PDF prefix or suffix without materializing the full file. Keep OPFS reads under existing locks and preserve old WorkspaceFsLike implementations through the adapter's bounded fallback. Real browser tests check actual Blob read sizes; the SQL workspace regression exercises compatibility.
This branch has not been deployed
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.
A bounded shell read of a large browser file currently materializes the entire file through
readFileBytes. Add an optionalreadFileRange(path, offset, length)capability and implement OPFS reads with nativeFile.slice()under the existing locks.WorkspaceFileSystemvalidates the range and falls back for older backends, so existing proxies remain compatible.This supplies the shared filesystem boundary for Rook's mounted-PDF fix and native range reads in Rook's just-bash fork. The separate upstream just-bash PR contains only byte conversion. This capability follows the File API slicing contract.
Validated all six package builds and the SDK check gate. Shell tests: 194 passing, plus eight real Chromium Worker/OPFS tests. The new browser regression instruments native Blob reads and forbids whole-file allocation; the SQL workspace regression verifies the legacy adapter fallback.