fix: do not use ReadableStream async iterator in SSE stream parsing#311
fix: do not use ReadableStream async iterator in SSE stream parsing#311ishymko merged 5 commits intoa2aproject:mainfrom
Conversation
Summary of ChangesHello @ilbertt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical browser compatibility issue related to Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🧪 Code Coverage
Generated by coverage-comment.yml |
There was a problem hiding this comment.
Code Review
The pull request introduces a polyfill for "Symbol.asyncIterator" on "ReadableStream" to enhance compatibility across different browser environments, particularly Safari. This is a valuable improvement for robust SSE stream parsing. The new "createAsyncIterator" and "pipeThrough" functions are well-structured, and the "try...finally" block in "createAsyncIterator" ensures proper resource cleanup. The added test cases effectively validate the new fallback mechanism and early termination scenarios. The identified type inaccuracies should be addressed for improved type safety and clarity.
ishymko
left a comment
There was a problem hiding this comment.
Thank you for the prompt fix!
BTW were you able to test it on a real iOS? We don't have this kind of integration tests running on a real iOS so if you were able to confirm it it'd be great.
I tested the workaround from my comment, and it was working. If you can release a beta/patch version, I'm happy to pull it in and test it |
ishymko
left a comment
There was a problem hiding this comment.
I tested the workaround from #308 (comment)
Sounds good, thank you!
A few minor comments and should be good to go.
|
@ishymko I've pushed some updates, let me know if I need to do anything else! |
ishymko
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
Should be released next week or the week after next at the latest.
🤖 I have created a release *beep* *boop* --- ## [0.3.10](v0.3.9...v0.3.10) (2026-01-27) ### Bug Fixes * do not use ReadableStream async iterator in SSE stream parsing ([#311](#311)) ([5359fa8](5359fa8)) * preserve typed error as cause in SSE errors ([#315](#315)) ([d39544e](d39544e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
The async iterator in
ReadableStreamis not available in browsers like Safari: MDN. This PR changes it to a lower-level API which has better support across different environments.Fixes #308.