From 35a9fd62224e39a0c4dcc2fa9372c89affa26cbb Mon Sep 17 00:00:00 2001 From: Isaac Roberts <119639439+madebyisaacr@users.noreply.github.com> Date: Tue, 7 Apr 2026 21:21:00 -0400 Subject: [PATCH 1/2] Always sync formula and relation properties --- plugins/notion/src/api.ts | 6 ++++++ plugins/notion/src/data.ts | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/notion/src/api.ts b/plugins/notion/src/api.ts index 08fe8c7eb..f542ab766 100644 --- a/plugins/notion/src/api.ts +++ b/plugins/notion/src/api.ts @@ -85,6 +85,12 @@ export const supportedCMSTypeByNotionPropertyType = { formula: ["string", "number", "boolean", "date", "dateTime", "link", "color"], } satisfies Partial> +/** + * These Notion property types are always re-synced even when the page's `last_edited_time` is unchanged. + * Formula results and relation values can change without the last edited time being updated in Notion. + */ +export const alwaysSyncedPropertyTypes = ["formula", "relation"] + // Naive implementation to be authenticated, a token could be expired. // For simplicity we just close the plugin and clear storage in that case. export function isAuthenticated() { diff --git a/plugins/notion/src/data.ts b/plugins/notion/src/data.ts index 995292e78..5215103fa 100644 --- a/plugins/notion/src/data.ts +++ b/plugins/notion/src/data.ts @@ -4,12 +4,13 @@ import { type FieldDataEntryInput, type FieldDataInput, framer, - ManagedCollection, + type ManagedCollection, type ManagedCollectionFieldInput, } from "framer-plugin" import pLimit from "p-limit" import * as v from "valibot" import { + alwaysSyncedPropertyTypes, assertFieldTypeMatchesPropertyType, type FieldInfo, getDatabase, @@ -230,8 +231,10 @@ export async function syncCollection( const field = fieldsById.get(property.id) if (!field) continue - // Skip field value if the item has not changed and the field type has not changed - if (isUnchanged && !updatedFieldIds.has(field.id)) continue + // Skip field value if the item has not changed and the field type has not changed. + // Always synced property types are never skipped. + if (isUnchanged && !updatedFieldIds.has(field.id) && !alwaysSyncedPropertyTypes.includes(property.type)) + continue const fieldEntry = getFieldDataEntryForProperty(property, field) if (fieldEntry) { From 00a2515c417dd22f2268bea2e52b2954de03aa5b Mon Sep 17 00:00:00 2001 From: Isaac Roberts <119639439+madebyisaacr@users.noreply.github.com> Date: Tue, 7 Apr 2026 21:24:09 -0400 Subject: [PATCH 2/2] Formatting --- plugins/notion/src/data.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/notion/src/data.ts b/plugins/notion/src/data.ts index 5215103fa..039470991 100644 --- a/plugins/notion/src/data.ts +++ b/plugins/notion/src/data.ts @@ -233,8 +233,13 @@ export async function syncCollection( // Skip field value if the item has not changed and the field type has not changed. // Always synced property types are never skipped. - if (isUnchanged && !updatedFieldIds.has(field.id) && !alwaysSyncedPropertyTypes.includes(property.type)) + if ( + isUnchanged && + !updatedFieldIds.has(field.id) && + !alwaysSyncedPropertyTypes.includes(property.type) + ) { continue + } const fieldEntry = getFieldDataEntryForProperty(property, field) if (fieldEntry) {