Skip to content

Commit

Permalink
fix: remove id from event stream messages
Browse files Browse the repository at this point in the history
This is a fix for issue #223. The event stream for
messages included a new id entry that was not
expected by the client.

Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Oct 17, 2024
1 parent 905d667 commit ff5f633
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/admin/app/lib/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export async function readStream<T>({

// Process complete messages
for (const message of messages) {
const dataString = message.replace(/^data: /, "").trim();
const dataString = message
.replace(/^id:.*\n/, "")
.replace(/^data: /, "")
.trim();
if (dataString) {
try {
const data = JSON.parse(dataString) as T;
Expand Down

0 comments on commit ff5f633

Please sign in to comment.