Skip to content
Source
Sign inSign up
TanStack/db

fix(sqlite): avoid writer-lock inversion during live Electric recovery #1910

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

Showing 13 changed files with 28 additions and 0 deletions (loading 10).

x
0 of 13 viewed, 13 left
6 additions and 0 deletions.changeset/fix-live-electric-opfs-resume-lock-order.mdAdded
View file
@@ -0,0 +1,6 @@
+---
+'@tanstack/db-sqlite-persistence-core': patch
+'@tanstack/browser-db-sqlite-persistence': patch
+---
+​
+Schedule ordinary persisted source commits before acquiring the browser writer lock, so they cannot deadlock with another Collection's hydration on a shared SQLite database. Add a real two-tab OPFS and live Electric recovery test for distinct schema versions and a torn legacy resume baseline.
7 additions and 0 deletions.github/workflows/e2e-tests.ymlModified
View file
@@ -79,6 +79,13 @@
cd packages/browser-db-sqlite-persistence
pnpm test:opfs-fairness
​
+ - name: Run Browser SQLite OPFS with live Electric E2E tests
+ run: |
+ cd packages/browser-db-sqlite-persistence
+ pnpm test:opfs-electric
+ env:
+ ELECTRIC_URL: http://localhost:3000
+​
- name: Run React Start SSR E2E tests
run: |
cd examples/react/start-ssr-e2e