Fix full sync on startup and block locked/protected note access#1
Open
s7eve1230 wants to merge 1 commit into
Open
Fix full sync on startup and block locked/protected note access#1s7eve1230 wants to merge 1 commit into
s7eve1230 wants to merge 1 commit into
Conversation
Without resetting syncToken on startup, fullSync runs incrementally and the server skips unchanged items_key elements. This causes decryption to fail with 'No items_key decrypted' on every cold start. Also surfaces the Standard Notes locked (edit-lock) flag through the note type and filters locked notes the same way protected notes are filtered: shown as [Protected] in notes_list and blocked in notes_get. Added sync() call in notes_get so protection state reflects the current server state without requiring a Claude Desktop restart.
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.
Without resetting syncToken on startup, fullSync runs incrementally and the server skips unchanged items_key elements. This causes decryption to fail with 'No items_key decrypted' on every cold start.
Also surfaces the Standard Notes locked (edit-lock) flag through the note type and filters locked notes the same way protected notes are filtered: shown as [Protected] in notes_list and blocked in notes_get. Added sync() call in notes_get so protection state reflects the current server state without requiring a Claude Desktop restart.
Problem
Two independent bugs:
On startup, fullSync runs incrementally instead of fetching all items. The syncToken from the previous session is restored from keychain, so the server skips unchanged items_key elements — decryption fails with No items_key decrypted on every cold start.
The Standard Notes locked (edit-lock) flag was not surfaced through the type system, so locked notes were accessible via MCP even when the user had explicitly protected them from editing.
Fix
Reset syncToken to null on startup so fullSync always fetches the full item set including items_key.
Add protected and locked fields to DecryptedNote, Note, and NoteSummary.
Filter locked and protected notes as [Protected] in notes_list.
Block notes_get for locked/protected notes with an explicit error.
Add client.sync() in notes_get so protection state is always fresh from the server.
Testing
Restart Claude Desktop → notes_list loads without decryption errors.
Create a locked note in the Standard Notes app → appears as [Protected] in notes_list, notes_get returns an error.