From 33e927897540526ab7611dff089bcbe08a380969 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 22 Aug 2026 13:25:26 -0400 Subject: [PATCH] Fix three breaks the removals left behind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **`snapshot_revision` was deleted with `create_titled`** (bc22f8e). I sliced the function out by scanning to the next `pub fn`, and the private `fn` sitting between them went too. Nothing in Python or TypeScript compiles Rust, so it sat undetected until the first lane that does. Restored verbatim. **An orphaned serde attribute** in push.rs: removing `pub kind: Option` left its `#[serde(skip_serializing_if)]` behind, which then stacked onto the next field's. That failed the derive, which is why three follow-on errors all said `Change: Serialize is not satisfied` — one cause, four messages. **An unbalanced ``** in NoteEditor.vue, orphaned when the "Links / Linked from" footer was cut. `vue-tsc --noEmit` type-checks the SCRIPT block and never parses the template, so the typecheck lane passed it and `vite build` caught it two workflows later. Worth remembering: a green typecheck says nothing about template structure. I also pushed step 2 without waiting for ad21eac to go terminal, which is what let the Rust break travel a commit further than it should have. Each fix comes with the check that would have caught it: a scan for stacked serde attributes and called-but-undefined fns across every .rs, and a tag balance pass over every .vue. Both are clean. --- core/src/local/store.rs | 13 +++++++++++++ core/src/sync/push.rs | 1 - frontend/src/components/NoteEditor.vue | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/local/store.rs b/core/src/local/store.rs index 07bef6b..1c36f17 100644 --- a/core/src/local/store.rs +++ b/core/src/local/store.rs @@ -373,6 +373,19 @@ pub fn create_note(conn: &Connection, input: &NoteCreateInput) -> rusqlite::Resu load_note(conn, &id) } +fn snapshot_revision(conn: &Connection, id: &str) -> rusqlite::Result<()> { + let (title, body): (Option, String) = + conn.query_row("SELECT title, body FROM notes WHERE id = ?1", [id], |r| { + Ok((r.get(0)?, r.get(1)?)) + })?; + conn.execute( + "INSERT INTO note_revisions (id, note_id, title, body, created_at) VALUES (?1, ?2, ?3, ?4, ?5)", + params![new_id(), id, title, body, now()], + )?; + Ok(()) +} + +/// PATCH semantics: apply exactly the fields present in `changes`. pub fn update_note(conn: &Connection, id: &str, changes: &Value) -> rusqlite::Result { let obj = changes .as_object() diff --git a/core/src/sync/push.rs b/core/src/sync/push.rs index f4ca47b..f39e7de 100644 --- a/core/src/sync/push.rs +++ b/core/src/sync/push.rs @@ -69,7 +69,6 @@ pub struct Change { #[serde(skip_serializing_if = "Option::is_none")] pub color: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[serde(skip_serializing_if = "Option::is_none")] pub pinned: Option, #[serde(skip_serializing_if = "Option::is_none")] pub archived: Option, diff --git a/frontend/src/components/NoteEditor.vue b/frontend/src/components/NoteEditor.vue index 87705ca..76b4736 100644 --- a/frontend/src/components/NoteEditor.vue +++ b/frontend/src/components/NoteEditor.vue @@ -627,7 +627,6 @@ function revPreview(rev: NoteRevision): string { -
-