Normalize IDs in distributeUpdate function for consistent publishing to NATS server
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-11-09 00:46:38 +00:00
parent f15ba0e489
commit e475cddb65

View File

@ -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) {