How auto-save and recovery work
Auto-save keeps a copy of every open tab in your browser’s storage. This page explains when that copy is written, why there are two copies, and how recovery picks between them, so you can tell what a reload or a crash will bring back.
When it saves
Section titled “When it saves”A save runs about 1 second after your last change. A check every 30 seconds saves anything that was missed, and a full save runs every 5 minutes regardless. Molkit also saves when you switch to another browser tab or another app, or close the page. Selecting, panning, and zooming do not count as changes, and nothing is saved in the middle of a drag.
Where it saves
Section titled “Where it saves”The full copy goes to the browser’s IndexedDB storage, which has room for large documents. A second, smaller copy goes to local storage so that the app can restore quickly on startup. Local storage holds only about 5 MB, so for large documents Molkit trims that second copy: first the undo history, then every tab except the active one. The full copy in IndexedDB is never trimmed, so no work is lost. If even the active tab alone is too large for local storage, Molkit skips the quick copy without an error message; the full copy is in IndexedDB, and a reload restores it.
How recovery chooses a copy
Section titled “How recovery chooses a copy”Recovery happens in two steps. The quick copy in local storage loads first. Right after that, Molkit checks the full copy in IndexedDB and uses it if it is newer or more complete, for example when the quick copy was trimmed for a large document.
If the browser closed partway through an auto-save, the newest full copy may never have been written. In that case, the active tab comes back from the newest copy, and any background tabs come back from the last complete copy. A background tab restored this way can be a little older than when you last saw it, but it is not empty.