Skip to content

Fix concurrent Web SQLite access across tabs - #195

Merged
zcourts merged 6 commits into
mainfrom
fix/web-storage-capability-preflight
Aug 28, 2026
Merged

Fix concurrent Web SQLite access across tabs#195
zcourts merged 6 commits into
mainfrom
fix/web-storage-capability-preflight

Conversation

@zcourts

@zcourts zcourts commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Fission Web applications can now use the same SQLite store from multiple tabs and overlapping page contexts. The Web provider moves from the single-owner OPFS SAH-pool VFS to SQLite 3.53's Web-Locks-backed opfs-wl VFS, so every tab keeps an independent connection while SQLite remains the locking and transaction authority.

The generated bridge derives a stable database namespace from app.app_id, making applications hosted on the same origin independent. Bridge installation is idempotent within a page, and the worker performs a one-time migration of databases created by the previous SAH-pool implementation before opening the new namespaced database. The official SQLite async OPFS proxy is now included in generated assets.

fission run and fission serve-web emit the cross-origin isolation headers required by opfs-wl. The storage guide documents the corresponding production hosting requirement. Generated framework-owned SQLite assets are refreshed during Web preparation so existing projects receive worker and SQLite fixes instead of retaining stale copies.

This also closes the setup gap where store-sqlite-web could compile without the storage capability that installs its JavaScript host. Web run/build preparation now verifies the resolved provider and capability agree, repairs missing generated assets, and reports a configuration error before compilation when they do not. Direct builds receive a typed missing-bridge error rather than an uncaught wasm-bindgen exception.

The browser conformance fixture opens two same-origin browsing contexts, writes through both SQLite connections, and verifies that both committed values are visible through the shared application database.

Closes #194

@zcourts
zcourts merged commit 0fb3f6d into main Aug 28, 2026
4 checks passed
@zcourts
zcourts deleted the fix/web-storage-capability-preflight branch August 28, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web SQLite OPFS worker fails when a second app context opens the store

1 participant