A failed DB persist makes the app permanently unquittable, silently — no error handler, no timeout, dead retry path
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 28
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
### What happened
If `frontend.db/persist!` fails for any reason, Logseq becomes impossible to close for the rest of
the session, with no message to the user and nothing in `logs/main.log` beyond a single misleading
line.
I hit this via logseq/logseq#8536 (see my reproduction in https://github.com/logseq/logseq/issues/8536#issuecomment-5157953158) (a `cljs-bean` `Bean` in the DB, triggered by a plugin creating a page with
properties) and traced the quit path end to end. The trigger is incidental — the quit machinery has
three independent flaws that turn *any* persist failure into a hard hang.
My instance sat unquittable for **2 days 16 hours**. Nothing was deadlocked or spinning: every thread
was sleeping, and the renderer answered `executeJavaScript` in 2 ms. The app was simply waiting
forever on a message that had already been sent — to a handler that doesn't exist.
### 1. `:persistent-dbs-error` has no handler
`electron.listener/persist-dbs!` wires the failure path:
```clojure
:on-error (fn [] (ipc/ipc "persistent-dbs-error"))
```
In the shipped `electron.js`, `persistent-dbs-saved` appears twice; **`persistent-dbs-error` appears
zero times.** It falls through to the `handle` multimethod's `:default`, which only logs — and logs
the *window object*, not the channel name, so the log line doesn't even identify what failed:
```
[2026-07-31 17:21:53.479] [error] Error: no ipc handler for: {
setBounds: '[function] …',
_events: { … 200 lines of BrowserWindow dump … }
}
```
That single line was the only trace of a 2.5-day outage.
### 2. The close handshake has no timeout
`electron.window/close-handler`:
```clojure
(defn close-handler [win close-watcher-f e]
(.preventDefault e) ;; window will not close
(.send web-contents "persistent-dbs") ;; ask renderer to save
(go (
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the quit flow through electron.listener/persist-dbs!, electron.window/close-handler, electron/core.cljs, and the shipped electron.js IPC handlers. Start by following the persistent-dbs success and error messages and the close listener state reset. Done means persist failures no longer leave the window unquittable, errors are surfaced or logged clearly, the close wait has a timeout, and retrying remains possible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, electron, javascript, node.js
- Domain
- backend, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100