From a351ecd77ab2e27d53c710be8c159989de6ae521 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sun, 9 Aug 2026 15:35:05 +0100 Subject: [PATCH] fix(editor-ext): stop persisting unfurl data on integration link nodes --- .../lib/integration-link/integration-link.ts | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/packages/editor-ext/src/lib/integration-link/integration-link.ts b/packages/editor-ext/src/lib/integration-link/integration-link.ts index 6a1d15286..f768d24a0 100644 --- a/packages/editor-ext/src/lib/integration-link/integration-link.ts +++ b/packages/editor-ext/src/lib/integration-link/integration-link.ts @@ -10,12 +10,12 @@ export interface IntegrationLinkOptions { export interface IntegrationLinkAttributes { url: string; provider: string; - unfurlData: Record | null; - status: "pending" | "loaded" | "error"; } // Shared by IntegrationLink (block) and IntegrationMention (inline) so both -// serialize the same attrs and stay convertible into each other. +// serialize the same attrs and stay convertible into each other. Unfurl data +// is intentionally NOT an attribute: it is fetched per viewer at render time +// so third-party permissions apply on every view. export function createIntegrationAttributes() { return { url: { @@ -35,31 +35,6 @@ export function createIntegrationAttributes() { "data-provider": attributes.provider, }), }, - unfurlData: { - default: null, - parseHTML: (element: HTMLElement) => { - const data = element.getAttribute("data-unfurl"); - if (!data) return null; - try { - return JSON.parse(data); - } catch { - return null; - } - }, - renderHTML: (attributes: IntegrationLinkAttributes) => ({ - "data-unfurl": attributes.unfurlData - ? JSON.stringify(attributes.unfurlData) - : null, - }), - }, - status: { - default: "pending", - parseHTML: (element: HTMLElement) => - element.getAttribute("data-status") ?? "pending", - renderHTML: (attributes: IntegrationLinkAttributes) => ({ - "data-status": attributes.status, - }), - }, }; }