Issue
A forced shutdown exposed two durability gaps in the current save path:
-
save_file_content may acknowledge a write before the OS flushes to disk, making recent saves non-durable on power loss.
-
On reopen, restoreStateOnReopen replays rawContent from LevelDB tab state, which can diverge from the on-disk file with no conflict detection and no revision trail to fall back to. The combination means a user can lose work with no recovery path.
Context
Markpad was used to edit and save an .md file on Windows, then the PC was force shut down. After reboot, the file contents did not match the version I expected.
-
I checked Markpad’s WebView/LevelDB local storage including 000003.ldb, 000006.ldb, 000007.log, LOG, LOG.old, and MANIFEST-000001.
-
I searched a copy of that folder for savedTabsData and for a distinctive missing-content token but found no recoverable prior content.
Proposed Fix
- Add an optional auto-save interval to reduce exposure between manual saves and forced shutdown.
- Persist a snapshot of tab state to LevelDB on each confirmed save, recoverable across sessions.
Issue
A forced shutdown exposed two durability gaps in the current save path:
save_file_content may acknowledge a write before the OS flushes to disk, making recent saves non-durable on power loss.
On reopen, restoreStateOnReopen replays rawContent from LevelDB tab state, which can diverge from the on-disk file with no conflict detection and no revision trail to fall back to. The combination means a user can lose work with no recovery path.
Context
Markpad was used to edit and save an .md file on Windows, then the PC was force shut down. After reboot, the file contents did not match the version I expected.
I checked Markpad’s WebView/LevelDB local storage including 000003.ldb, 000006.ldb, 000007.log, LOG, LOG.old, and MANIFEST-000001.
I searched a copy of that folder for savedTabsData and for a distinctive missing-content token but found no recoverable prior content.
Proposed Fix