Local database corruption is not recoverable / "no backend registered" errors with empty inboxes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- playwright, sqlite, typescript
Direzione di ricerca
Start with src/db/shared-worker.ts and src/db/bootstrap-idb.ts to trace how boot failures are cached, then read src/stores/auth-store.ts and src/sync/sync-client.ts for error handling and backend lookup. Check AGENTS.md for the Playwright test setup and inspect the related pull request #227. Done means a corrupted cache can recover and resync, with typed errors and coverage for that flow.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The browser keeps a disposable SQLite cache (wa-sqlite on IndexedDB, in a SharedWorker), and the UI reads only from that cache. Corruption of the local copy therefore leaves the app unusable even though the server data is intact.
Findings from reading the code
- No corruption handling. Nothing in
src/db,src/storesorsrc/synchandlesSQLITE_CORRUPT/NOTADBor deletes and rebuildsstormbox.sqlite. The only recovery currently is for the user to clear site data by hand. - Boot failure is cached forever.
getHandlers()(src/db/shared-worker.ts) andbootProductionEngine()(src/db/bootstrap-idb.ts) keep a rejected promise. After one failed boot, every RPC from every tab fails until the worker dies, andstartSyncAccountnever registers a backend. - Raw error shown.
reportDatabaseError(src/stores/auth-store.ts) only recognisesDatabaseUnavailableError, which is created only for the Firefox startup timeout. A corruption error is shown as its raw message, with no recovery steps. - "No backend registered" message. It comes from
SyncClient.getBackend(src/sync/sync-client.ts:62) as a plainError, not the typedaccountUnavailableused elsewhere insync-host.ts. It occurs when a tab holds anaccountIdbut the worker's backend map has no entry for it, for example after a worker restart or replacement without the tab reloading. - Suspected trigger, not confirmed. The corruption may relate to the Firefox exclusive-locking and journal change (#228), or the wa-sqlite 2.0.9 upgrade (#229), acting on a database written by an earlier build. Mixed asset versions across tabs could also contribute.
Related: https://github.com/thunderbird/stormbox/pull/227
To Reproduce
- Boot failure is cached. In a profile with Webmail signed in, corrupt the
stormbox.sqliteIndexedDB data (for example, overwrite a block through DevTools) and reload.- Expected from the code: the raw "malformed" message appears, and a reload without closing all tabs does not recover.
- "No backend" message. With Stormbox signed in, cause the SharedWorker to be replaced without the tab reloading. Examples are a Firefox handoff via a second tab on a different build, or killing the worker from
about:debuggingorchrome://inspect/#workers.- Check whether the original tab shows empty inboxes and "No jmap-mail backend registered for account N".
- Affected users. Ask for browser and version, whether the database predates Oct 26, whether several tabs were open, and the console output. Look for
[worker:sync-host] startAccount completeand anyshared-workerboot or restart warnings. - Clearing site data. Check that it fixes both reports. If it does, that confirms the cache is the cause.
Expected behavior
Corrupted databases should hopefully have a path for self-heal. This is a proposed fix (not implemented):
- On
SQLITE_CORRUPT/NOTADBduring open or migrations, delete the IndexedDB database and boot once more. - Don't cache a rejected boot promise.
- Map corruption to a typed UI error with recovery instructions.
- Make
getBackendthrow the typedaccountUnavailableerror, and have the store re-runstartSyncAccounton it. - Add Playwright coverage (per AGENTS.md) for a corrupted database recovering and resyncing.
Actual behavior
Empty mailbox with a database error per screenshot below.
Screenshots
System
- OS: macOS Tahoe 26.6.2
- Browser Version: Firefox 158.0
- Lingua principale
- TypeScript
- Stelle
- 121
- Fork
- 11
- Merge medio
- 1g 3h
- PR unite (30g)
- 11
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di thunderbird/stormbox
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
thunderbird/stormbox#260 ·
I maintainer di solito rispondono entro 1 giorno
-
ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
thunderbird/stormbox#254 ·
I maintainer di solito rispondono entro 1 giorno
-
mobile ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
thunderbird/stormbox#182 ·
I maintainer di solito rispondono entro 1 giorno
-
mobile ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
thunderbird/stormbox#179 ·
I maintainer di solito rispondono entro 1 giorno
-
mobile ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
thunderbird/stormbox#175 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di thunderbird/stormbox
Issue simili
-
Report: Voyo Sport 1 HDApertaapproved check:passed streams:remove
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Monthly Not a priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Expensify/App#107229 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
GitTools/actions#2297 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
hiero-ledger/hiero-sdk-js#4793 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/vscode-cosmosdb#3594 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno