Skip to content
Source
Sign inSign up
TanStack/db

fix(browser-sqlite): bound OPFS database opening #1936

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/1936/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 9 changed files with 118 additions and 0 deletions (loading 6).

x
0 of 9 viewed, 9 left
5 additions and 0 deletions.changeset/bound-browser-opfs-open.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/browser-db-sqlite-persistence': patch
+---
+​
+Browser OPFS database opening previously waited without a deadline. It now rejects after 30 seconds by default and terminates the pending worker instead of acquiring the database later. Set `timeoutMs: 0` to keep the previous unbounded wait, override the deadline with another value, or pass an `AbortSignal` to cancel a pending open.
12 additions and 0 deletionsdocs/contributing/oracle-coverage.mdModified
View file
@@ -132,6 +132,18 @@
Cloudflare's documented 100-bound-parameter query limit and checks the durable
keys after each transaction. This Node SQLite seam does not execute in Workers.
​
+The browser OPFS lifecycle owner also checks that a silent initialization
+rejects at the default or overridden open deadline, terminates its worker,
+ignores a late response, and releases the deadline and abort listener after a
+successful open. It also checks an abort during synchronous option evaluation,
+after the initial signal check but before listener registration. A Chromium
+fixture holds the VFS database Web Lock while a second tab times out. It checks
+that the queued request disappears, then reopens the database after releasing
+the lock. This controlled lock holder does not
+reproduce a frozen tab or establish behavior in other browsers.
+The [issue #1883 review record](oracle-reviews/issue-1883-opfs-open-deadline.md)
+preserves the exact-head unit and Chromium evidence and the queued-lock mutant.
+​
The ordered-work owner also checks that an Effect with `skipInitial` waits for