Add verification script for issue #27 (autosave batching) - #42
Merged
pradipNP merged 1 commit intoSep 17, 2026
Merged
Conversation
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.
Summary
Investigated issue #27 (autosave creating many individual IndexedDB transactions per drawn object, causing slow saves). Traced the full object-commit path used by every drawing tool:
endStroke()/finishShape()(js/modules/tools.js) →commitIfChanged()(js/core/history.js) → debouncedscheduleAutosave()(400ms, js/modules/persistence.js) → singledbSaveBoard()→ onereadwritetransaction viatx.put().This confirmed the debounce and single-transaction batching described as the desired fix in #27 are already implemented and correctly wired for every drawing tool (pen, shapes, text, etc). No functional code change was needed.
Added a lightweight browser-console verification script (
scripts/verify-autosave-batching.js) that simulates adding 100 objects rapidly and asserts the benchmark from #27: fewer than 10 IndexedDB transactions and completion well within the expected time budget.Type of change
Verification / regression-test script — no application code was changed.
Test plan
scripts/verify-autosave-batching.jsin the browser console after drawing 100 simulated objects: transaction count and timing both passed the benchmark from [Performance]: Autosave creates many individual transactions; IndexedDB slow #27Screenshots (if UI changed)
N/A — no UI changes.
Related issues
Closes #27