Skip to content

fix(listener): Limit retries to a maximum of three. #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 2, 2025

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