Skip to content

Add verification script for issue #27 (autosave batching) - #42

Merged
pradipNP merged 1 commit into
pradipNP:mainfrom
AchieverSana:fix/27-verify-autosave-batching
Sep 17, 2026
Merged

pradipNP merged 1 commit into
pradipNP:mainfrom
AchieverSana:fix/27-verify-autosave-batching

Conversation

@AchieverSana

Copy link
Copy Markdown
Contributor

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) → debounced scheduleAutosave() (400ms, js/modules/persistence.js) → single dbSaveBoard() → one readwrite transaction via tx.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

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Other (describe below)

Verification / regression-test script — no application code was changed.

Test plan

Screenshots (if UI changed)

N/A — no UI changes.

Related issues

Closes #27

@pradipNP
pradipNP merged commit 7b38dab into pradipNP:main Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Performance]: Autosave creates many individual transactions; IndexedDB slow

2 participants