From 8dabbba09216d066e82c486a6d8640c8c6ca114e Mon Sep 17 00:00:00 2001 From: Chris Peyer Date: Wed, 13 May 2026 10:41:19 -0400 Subject: [PATCH] fix: coerce non-string da-metadata values to avoid "[object Object]" setDaMetadata is the single boundary into the daMetadata Y.Map, but it forwarded values verbatim. doc2aem later interpolates each value into a
${value}
, so any non-string entry (object, Y type) ended up serialized as the literal string "[object Object]" in saved HTML. Coerce at the boundary: stringify objects via JSON.stringify, other non-strings via String(), and warn so the offending caller surfaces. Co-Authored-By: Claude Opus 4.7 --- blocks/edit/utils/helpers.js | 13 +++++++++-- test/unit/blocks/edit/utils/helpers.test.js | 25 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/blocks/edit/utils/helpers.js b/blocks/edit/utils/helpers.js index 51a0494be..dc34d7e25 100644 --- a/blocks/edit/utils/helpers.js +++ b/blocks/edit/utils/helpers.js @@ -345,9 +345,18 @@ export function setDaMetadata(key, value) { if (!daMdMap) return; if (value === null || value === undefined) { daMdMap.delete(key); - } else { - daMdMap.set(key, value); + return; + } + // The Y.Map serializes to a