Description
When using OPFSCoopSyncVFS, rapid page refreshes (especially pull‑to‑refresh on Safari iOS) can cause database initialization to time out. The new page can’t acquire OPFS file locks because the previous page’s worker hasn’t released them yet.
Environment
- @powersync/web: 1.30.0
- Browser: Safari 26.1 (iOS and macOS)
- VFS: OPFSCoopSyncVFS
Configuration
- VFS: OPFSCoopSyncVFS (Dedicated Worker for DB)
- Multi‑tabs: enabled (SharedWorker for sync)
- Issue occurs regardless of Sync Worker type — lock appears to be held by DB worker.
Reproduction
- Open an app using PowerSyncDatabase with OPFSCoopSyncVFS
- Wait for database to initialize and connect
- Pull‑to‑refresh (iOS) or Cmd+R (macOS) rapidly
- After 1–3 refreshes, database initialization times out
Expected
Database initializes successfully after refresh.
Actual
Database initialization times out.