From 5b6117f03795ffd71bad7b57df4ddcec4e6cad4a Mon Sep 17 00:00:00 2001 From: jpeg729 Date: Sat, 17 Jan 2026 13:05:01 +0100 Subject: [PATCH 1/2] Fix data received by delayed on-signal-patch --- .../src/plugins/attributes/onSignalPatch.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/library/src/plugins/attributes/onSignalPatch.ts b/library/src/plugins/attributes/onSignalPatch.ts index 90baa817..084fc65b 100644 --- a/library/src/plugins/attributes/onSignalPatch.ts +++ b/library/src/plugins/attributes/onSignalPatch.ts @@ -29,26 +29,27 @@ attribute({ filters = jsStrToObject(filtersRaw) } - let running = false - - const callback: EventListener = modifyTiming( + const timedCallback = modifyTiming( (evt: CustomEvent) => { - if (running) return - const watched = filtered(filters, evt.detail) - if (!isEmpty(watched)) { - running = true - beginBatch() - try { - rx(watched) - } finally { - endBatch() - running = false - } + beginBatch() + try { + rx(evt.detail) + } finally { + endBatch() } }, mods, ) + const callback: EventListener = (evt: Event | CustomEvent) => { + // we know that evt is CustomEvent, but typescript doesn't + const watched = filtered(filters, (evt as CustomEvent).detail) + if (!isEmpty(watched)) + { + timedCallback({...evt, detail: watched}) + } + } + document.addEventListener(DATASTAR_SIGNAL_PATCH_EVENT, callback) return () => { document.removeEventListener(DATASTAR_SIGNAL_PATCH_EVENT, callback) From eb7564a78b0ebe7b59274d44c3c674d7a71d15dd Mon Sep 17 00:00:00 2001 From: jpeg729 Date: Sat, 17 Jan 2026 12:19:44 +0000 Subject: [PATCH 2/2] Update library/src/plugins/attributes/onSignalPatch.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- library/src/plugins/attributes/onSignalPatch.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/src/plugins/attributes/onSignalPatch.ts b/library/src/plugins/attributes/onSignalPatch.ts index 084fc65b..e7c60262 100644 --- a/library/src/plugins/attributes/onSignalPatch.ts +++ b/library/src/plugins/attributes/onSignalPatch.ts @@ -44,8 +44,7 @@ attribute({ const callback: EventListener = (evt: Event | CustomEvent) => { // we know that evt is CustomEvent, but typescript doesn't const watched = filtered(filters, (evt as CustomEvent).detail) - if (!isEmpty(watched)) - { + if (!isEmpty(watched)) { timedCallback({...evt, detail: watched}) } }