Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@HugoMuller
Copy link
Contributor

resolves #1168

Add support for comment, so doing this is now possible (see #1168 for a full reproduction scenario):

const eventStream = createEventStream(event);
await eventStream.push({ comment: 'keep-alive' });

@pi0
Copy link
Member

pi0 commented Jul 23, 2025

Nice idea. Howevr combining API to send normal messages with comments might be tricky since someone might want to send an actual object with comment key in it.

We might introduce ee.pushComment(...) instead.

Can you please also rebase to main branch? (we could backport if necessary after)

@HugoMuller HugoMuller force-pushed the v1-sse-handle-comment branch from cb9fd16 to 887499d Compare July 23, 2025 17:11
@HugoMuller HugoMuller changed the base branch from v1 to main July 23, 2025 17:11
@HugoMuller HugoMuller requested a review from pi0 as a code owner July 23, 2025 17:11
@HugoMuller
Copy link
Contributor Author

I rebased and the PR targets base now.

I kept ee.push(...) untouched and added a new method ee.pushComment().
I also introduced a new formatEventStreamComment() but I wanted to keep only 1 _sendEvent to handle both comment and message.
Is this ok by you?

@pi0
Copy link
Member

pi0 commented Jul 23, 2025

Thanks for update. It would be probably better to keep these two fully seperated to avoid internal bugs.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ❤️

@pi0 pi0 merged commit 0ca624d into h3js:main Aug 27, 2025
3 checks passed
@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

❌ Patch coverage is 57.89474% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/utils/internal/event-stream.ts 57.89% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSE support for comment message

2 participants