fix(wa-sqlite): allow long OPFS database paths - #213
Merged
Conversation
This was referenced Jul 12, 2026
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.
What
Allow valid OPFS database paths longer than wa-sqlite's 64-byte VFS default.
TreeCRDT now advertises a 512-byte pathname capacity before registering either OPFS VFS:
Why
SQLite appends sidecar names such as
-journaland-walafter checking the VFS pathname capacity. A 58-byte database path therefore becomes a 66-byte journal path and fails with the genericSQLITE_CANTOPEN/sqlite3_open_v2error when the VFS reports 64 bytes.This was reproduced exactly in Chromium:
-journal: opens.-journal: fails with the old limit.The failure looked like an OPFS drop/reopen race in #164 only because its normal-priority filename was four characters shorter than its background-priority filename.
Scope / fast paths
Regression coverage
The existing browser lifecycle matrix now deliberately uses a database path whose
-journalform exceeds 64 bytes. It covers both direct/AnyContext and dedicated-worker/CoopSync clients, explicit close and reload teardown, persistence, and drop cleanup.Verification
git diff --checkpass.