You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
browser: BrowserDb.open() does not write migrated pages back to IndexedDB #411
BrowserDb.open() loads all pages from IndexedDB into a BrowserBufferBackend. Then it calls PersistentFactStorage::new(buffer, 0), which runs the normal load path. If the stored data is in an older file format, that load path upgrades it (migrate_v1_to_v2, migrate_v5_to_v6, and the one-per-page repack in load()). The upgrade writes new pages to the buffer and marks them dirty.
open() never sends those dirty pages to IndexedDB. So the upgraded pages only exist in memory. The IndexedDB copy stays in the old format until one of these happens:
a transact or retract through execute()
a call to checkpoint()
import_graph() does not have this problem. It takes the dirty set and writes it right after PersistentFactStorage::new.
Impact
Today this is a latent issue. IndexedDB support shipped in v0.20.0 with format v7, and the format has not changed since. So no existing IndexedDB database needs an upgrade yet.
It will matter when the format changes again (for example #388, format v8):
A read-only session upgrades the data in memory on every open. The work is repeated each time and the stored copy never changes.
If the upgrade also fixes a problem in the stored data, such as an index rebuild after a checksum mismatch, that fix is also not saved.
Proposed fix
In BrowserDb::open() (src/browser/mod.rs), after PersistentFactStorage::new(...), do the same thing import_graph() does:
Call pfs.with_backend_mut(|b| b.take_dirty()).
Read those pages with read_page_raw.
If the set is not empty, call idb.write_pages(...) before returning.
On a normal open with no upgrade, the dirty set is empty, so this adds no IndexedDB write.
Activity
Merge pull request #474 from project-minigraf/fix/411-440-browser-pages
adityamukho commentedon Oct 7, 2026
Fixed on
v3by #474 (merge deb82a4); ships in v3.0.0.