Repository navigation
Saves wait for a 5 s rest: fewer full rewrites into Sync history (#274) - #278
Merged
Merged
Conversation
Every save rewrites the whole notebook, and Obsidian Sync keeps each write as a version for a month. A save now waits until the pen has rested 5 s (was 1 s) and at most 60 s (was 20 s): about 56 saves an hour of writing instead of about 246. PDF rasterising and the background save worker keep the 1 s quiet; a pen held down 20 s still counts as a lost lift. Leaving the app, closing the notebook and unloading still save at once. A save Obsidian asks for after the pen's quiet timer has run now gets a timer of its own, so it is not left waiting for the next stroke. Refs #274 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #274. This is the quick mitigation, not the fix. The per-page storage design is on a review page and needs Joost's and Oskar's decision before the file format changes.
Problem: every save rewrites the whole notebook (about 1.6 MB for the reporter's 30 pages), and Obsidian Sync keeps each write as a version for a month, counted against the plan. A model of an hour of note-taking, run through Obsidian's 2 s
requestSaveandWriteHold, gives about 246 saves an hour, so about 390 MB a writing hour.Change:
SAVE_QUIET_MS, was 1 s), and at most 60 s (MAX_SAVE_HOLD_MS, was 20 s). That is about 56 saves an hour.QUIET_MS): PDF rasterising and the background save worker's wait for the pen.LOST_LIFT_MS).Trade-off on the iPad:
visibilitychange), closing the notebook, opening another file in the tab, unloading.What it does not fix: a heavy user still passes 1 GB a month, and notebooks still pass Sync Standard's 5 MB per-file limit (near page 90 at the reporter's density).
Tested:
typecheck,lint,lint:review,format:check,test,build.tests/view/write-hold.test.tsandtests/view/ink-view-file.test.tscover the three waits, the late Obsidian save and the overdue save while writing.🤖 Generated with Claude Code