From 1923bb87b8e661e7d1bf139fe49f6a1cd5077d14 Mon Sep 17 00:00:00 2001 From: afiqzudinhadi Date: Thu, 30 Jul 2026 12:30:57 +0800 Subject: [PATCH] fix(watchlist): normalize notion_url null-sentinel in buildRecord prev-read quotedOrNull renders an empty notion_url as the literal string `null`. buildRecord read that back verbatim on the next sync pass and re-quoted it as "null", breaking diff-on-write (every re-sync of a note with no notion_url appeared changed). Treat the `null` sentinel as empty when reading prev frontmatter. --- packages/obsidian/src/watchlist/build.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/obsidian/src/watchlist/build.ts b/packages/obsidian/src/watchlist/build.ts index 2b3744c..4c994a4 100644 --- a/packages/obsidian/src/watchlist/build.ts +++ b/packages/obsidian/src/watchlist/build.ts @@ -139,7 +139,8 @@ export function buildRecord(details: TmdbDetail, isMovie: boolean, prev: Record< let watchStatus = prev['watch_status'] || 'Unwatched'; const rating = prev['rating'] || '0'; const ratingStars = prev['rating_stars'] ?? ''; - const notionUrl = prev['notion_url'] || ''; + const rawNotionUrl = prev['notion_url'] || ''; + const notionUrl = rawNotionUrl === 'null' ? '' : rawNotionUrl; // quotedOrNull renders empty as literal `null` — don't round-trip it as a value // ---- TV watch-status rule: new episode aired since last sync ---- const prevLast = (prev['last_air_date'] ?? '').trim().replace(/^"|"$/g, '');