fix(DeesComms): Skip routing hooks for BroadcastChannel-received messages to prevent infinite loops; update typedrequest dependency and bump package version.

This commit is contained in:
2025-12-04 23:52:12 +00:00
parent 10e0c5ca92
commit 6bf7061e84
5 changed files with 23 additions and 14 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-comms',
version: '1.0.28',
version: '1.0.30',
description: 'A communications module for enabling DOM-based messaging and synchronization across browser tabs and workers.'
}

View File

@@ -25,7 +25,9 @@ export class DeesComms {
this.broadcastChannel.onmessage = async (eventArg) => {
const message = (eventArg as any).method ? eventArg : eventArg.data;
console.log(JSON.stringify(message));
const response = await this.typedrouter.routeAndAddResponse(message);
// Skip hooks for broadcast-received messages to prevent infinite loops
// when traffic logging hooks are set up globally
const response = await this.typedrouter.routeAndAddResponse(message, { skipHooks: true });
if (response && !response.error) {
this.postMessage(response);
} else {