Skip to content

Concurrency issue on Chrome & Safari with OPFS #428

@xvrh

Description

@xvrh

We are desperately trying to find a workaround for an issue where users are getting stuck infinitely on our loading screen. This occurs on both Chrome and Safari.

We have set up a reproduction repository for experimentation, and we can trigger various edge cases that leave the database in a bad state. After hitting the bug, the only way to restore functionality is to kill the shared service worker or restart the browser.
https://github.com/xvrh/powersync-web-hang-repro

Chrome:
After a few attempts, the database fails to connect and throws the following error in the console: A call to getWebLock has been aborted. Normal functionality is restored once the shared worker is killed.
https://github.com/user-attachments/assets/87ba737e-ebe6-4f1a-b1e3-d3c09121b9c6

Safari:
ERROR: SqliteException(0): Dangling transaction detected. If you want to use BEGIN statements manually, COMMIT or ROLLBACK them before returning from writeLock.
https://github.com/user-attachments/assets/cfe933c9-9bf1-4cf4-9a0a-312c97641e4d

I also encountered a couple other variations of this bug on Safari with different behaviours, though I was unable to capture them on camera.

I am submitting this report in hopes that it helps isolate the underlying bug our users are experiencing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions