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 8b72d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/admin/app/lib/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function readStream<T>({

// Process complete messages
for (const message of messages) {
const dataString = message.replace(/^data: /, "").trim();
const dataString = message.replace(/^(.*)\n/, "").replace(/^data: /, "").trim();

Check failure on line 42 in ui/admin/app/lib/stream.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `.replace(/^(.*)\n/,·"").replace(/^data:·/,·"")` with `⏎····················.replace(/^(.*)\n/,·"")⏎····················.replace(/^data:·/,·"")⏎····················`
if (dataString) {
try {
const data = JSON.parse(dataString) as T;
Expand Down

0 comments on commit 8b72d98

Please sign in to comment.