From e475cddb6594f341ffc726e3ca42c8f3a6682136 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 9 Nov 2026 00:46:38 +0000 Subject: [PATCH] Normalize IDs in distributeUpdate function for consistent publishing to NATS server --- src/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 01d8bb4..97a98e6 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1722,7 +1722,11 @@ function filterDistributeKeys(value, keys = DISTRIBUTE_KEYS) { } async function distributeUpdate(value, id, type) { - await natsServer.publish(`${type}s.${id}.object`, { ...value, _id: id }); + const normalizedId = id == null ? id : String(id).toLowerCase(); + await natsServer.publish(`${type}s.${normalizedId}.object`, { + ...value, + _id: normalizedId, + }); } async function distributeStats(value, type) {