Akhil/notes metadata body split - #274
Merged
Merged
Conversation
Bodies are moving out of the notes metadata array, so the compound `id|updatedAt` cache key would go stale (metadata updatedAt no longer advances on every body save). Key by id and have every write path overwrite its entry explicitly. Adds delete/clear so a removed note's text is dropped and a vault lock clears all plaintext from memory. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aqzbw8Z5mbR5bNMp3pWfvk
…e delete The notes list feeds the sidebar, which needs metadata only, but it was returning the full meta_json row — every encrypted body — forcing the UI to decrypt the whole vault on open. Null the content field unless ?content=1 (the search-index warm). Recursive delete re-listed every note once per tree level; build the parentId -> children map once and BFS it, with a cycle guard. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aqzbw8Z5mbR5bNMp3pWfvk
…arch Opening Notes decrypted every note body, and every autosave replaced the notes array — rebuilding noteById/childrenMap/sortedNotes and re-rendering the whole sidebar tree once per second while typing. Metadata and bodies now have separate lifetimes: - `notes` holds metadata only; bodies live in a new NotesContentContext that only the editor subscribes to, so body writes can't touch the sidebar. A content-only save skips setNotes entirely and parks the server's new updatedAt until the next note switch. - refreshNotes does no crypto at all; the active note's body is fetched and decrypted on demand. - Bodies and the search index are tagged with the cipher key they were decrypted under, so a vault lock invalidates both on read. The module-level plain-text cache is cleared explicitly on key change so decrypted text doesn't outlive the unlocked session. - Sidebar search warms the plain-text index once, on the first query of the session, reusing the existing Notes.sidebar.loading string. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aqzbw8Z5mbR5bNMp3pWfvk
Contributor
|
Unable to deploy a commit from a private repository on your GitHub organization to the itsmeakhil's projects team on Vercel, which is currently on the Hobby plan. In order to deploy, you can:
To read more about collaboration on Vercel, click here. |
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.
No description provided.