Skip to content

Commit

Permalink
Fix websocket msg serialisation
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Evans <ebrian101@gmail.com>
  • Loading branch information
mrbrianevans committed Oct 5, 2023
1 parent 6599d49 commit 37618df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/redis/streamFromRedis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 37618df

Please sign in to comment.