Skip to content

Conversation

@usualoma
Copy link
Member

@usualoma usualoma commented Aug 2, 2025

fixes #266

If the application did not include Transfer-Encoding: chunked, depending on the timing of enqueue, it would loop indefinitely until the second chunk was read.

One way to do this is to treat text/event-stream as special, as @yusukebe pointed out in this comment, but I would prefer to resolve this without depending on a specific Content-Type.

#265 (comment)

Essentially, the problem was simply #265's i-- and currentReadPromise = reader.read(), so I think that fixing that should be sufficient without any additional logical changes.

Minimal reproducible example

https://github.com/usualoma/hono-se-266

@usualoma
Copy link
Member Author

usualoma commented Aug 2, 2025

@yusukebe
Would you please review this?

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

yusukebe commented Aug 2, 2025

Hi @usualoma

I've tried some edge cases based on your repro. They work well! Looks good, thank you!

@yusukebe yusukebe merged commit 6ad5ca7 into honojs:main Aug 2, 2025
5 checks passed
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.

v1.18.0 breaks Server-Sent Events (SSE) real-time streaming - first chunk delayed by pre-read logic

2 participants