Skip to content

Add note body revision history so a bad overwrite is recoverable - #54

Merged
chasehuh merged 1 commit into
mainfrom
issue-52-note-revisions
Jul 30, 2026
Merged

Add note body revision history so a bad overwrite is recoverable#54
chasehuh merged 1 commit into
mainfrom
issue-52-note-revisions

Conversation

@chasehuh

Copy link
Copy Markdown
Member

Summary

  • Add idempotent note_revisions table (cascade on note delete) and record the previous body on every body-changing updateNote, atomically with the overwrite.
  • Coalesce autosave bursts (60s) and purge revisions older than 30 days via /api/cron/purge-note-revisions; revision-insert failures never fail the user save.
  • Document operator recovery/restore SQL in the README; export listNoteRevisions for programmatic listing. No user-facing history UI.

Closes #52

Test plan

  • pnpm test (includes revision write / identical skip / previous body / insert-failure resilience / purge)
  • pnpm build
  • Local: edit a note, confirm note_revisions grows and newest row holds the previous body
  • Type continuously ~60s and confirm revision count stays coalesced
  • Simulate revision-insert failure and confirm save still succeeds

Made with Cursor

Closes #52.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview Jul 30, 2026 4:31am

Request Review

@chasehuh
chasehuh merged commit 8d30561 into main Jul 30, 2026
2 checks passed
@chasehuh
chasehuh deleted the issue-52-note-revisions branch July 30, 2026 04:40
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.

Add note body revision history so a bad overwrite is recoverable

1 participant