From 37618df04c3d62a42834cd8276094bc8e7fd16f2 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Thu, 5 Oct 2023 18:15:56 +0100 Subject: [PATCH] Fix websocket msg serialisation Signed-off-by: Brian Evans --- server/src/redis/streamFromRedis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/redis/streamFromRedis.ts b/server/src/redis/streamFromRedis.ts index fff594d..13c23f6 100644 --- a/server/src/redis/streamFromRedis.ts +++ b/server/src/redis/streamFromRedis.ts @@ -182,7 +182,7 @@ const eventStream = listenRedisStream({ streamKeys: [...streamPaths].map(stream for await(const event of eventStream) { const streamPath = event.stream.split(":")[1] let parsedEvent = JSON.parse(event.data.event) - app.server?.publish(streamPath, { streamPath, ...parsedEvent }) + app.server?.publish(streamPath, JSON.stringify({ streamPath, ...parsedEvent })) if (streamPath === "companies") await saveCompanyNumber(counterClient, parsedEvent, streamPath) .catch(e => logger.error(e, "Error saving company number"))