electric-sql / electric-sql/pglite
`db.listen()` in `@electric-sql/pglite` Hangs Permanently Inside an Electron nodejs Worker Thread
- Dominant language
- TypeScript
- Stars
- 16k
- Forks
- 442
- Avg merge
- 20h 19m
- Merged PRs (30d)
- 7
Description
@electric-sql/pglite: v0.3.6
@electric-sql/pglite-sync: v0.3.9
@electron: v35.1.5
node version: v22.14.0
Hello,
I am implementing a local-first application using ElectricSQL and PGlite within an Electron main process. The synchronization logic is based on the "Local Writes" pattern from the official examples and runs inside a Node.js `worker_thread`.
The Problem
I've identified that the application hangs when initializing the change synchronizer (sync.ts). Specifically, the `await this.#db.listen('changes', ...)` call never resolves, which prevents the synchronization process from starting and appears to block all other PGlite commands within that worker.
The issue occurs in the `start()` function of my `ChangeLogSynchronizer` class:
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.