Skip to content

fix(sse): support data: prefix without space#188

Merged
yarolegovich merged 2 commits intoa2aproject:mainfrom
herczyn:fix-sse-compatibility
Feb 4, 2026
Merged

fix(sse): support data: prefix without space#188
yarolegovich merged 2 commits intoa2aproject:mainfrom
herczyn:fix-sse-compatibility

Conversation

@herczyn
Copy link
Copy Markdown
Member

@herczyn herczyn commented Feb 3, 2026

fixes #162

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @herczyn, 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 addresses a compatibility issue in SSE data parsing where some frameworks omit the space between the data: prefix and the actual data. The changes ensure that the ParseDataStream function can correctly handle this format, improving interoperability with services that generate SSE streams in this manner. A new test case validates the fix.

Highlights

  • SSE Data Parsing: The pull request modifies the ParseDataStream function in internal/sse/sse.go to support the data: prefix without a space following it. This change enhances compatibility with frameworks like Spring that may omit the space.
  • Compatibility Test: A new test case, TestSSE_NoSpaceCompatibility, is added in internal/sse/sse_test.go to verify the correct parsing of SSE data when the data: prefix is directly followed by the payload without a space.
  • Test Implementation: The test case sets up a mock server that intentionally sends SSE data without a space after the data: prefix. It then asserts that the ParseDataStream function correctly parses this data.
Changelog
  • internal/sse/sse.go
    • Modified ParseDataStream to support 'data:' prefix without a space.
  • internal/sse/sse_test.go
    • Added TestSSE_NoSpaceCompatibility to verify parsing of SSE data without space after 'data:' prefix.
Activity
  • Code modified to support SSE data without space after the 'data:' prefix.
  • New test case added to validate the fix.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for SSE data: fields that don't have a space after the colon, which improves compatibility. The implementation in sse.go introduces some code duplication, which can be refactored for better maintainability. Additionally, the new test case in sse_test.go can be simplified to be more direct and easier to understand. My review includes suggestions for both of these points.

@herczyn herczyn force-pushed the fix-sse-compatibility branch 2 times, most recently from 0f06f98 to 0edfd21 Compare February 4, 2026 10:29
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@herczyn herczyn force-pushed the fix-sse-compatibility branch from 0edfd21 to af66f55 Compare February 4, 2026 10:53
@herczyn herczyn requested a review from yarolegovich February 4, 2026 10:59
@yarolegovich
Copy link
Copy Markdown
Member

Thanks for the contribution!

@yarolegovich yarolegovich merged commit 6657a6d into a2aproject:main Feb 4, 2026
4 checks passed
yarolegovich pushed a commit that referenced this pull request Feb 23, 2026
🤖 I have created a release *beep* *boop*
---


## [0.3.7](v0.3.6...v0.3.7)
(2026-02-20)


### Features

* implement tasks/list RPC
([#210](#210))
([6e04698](6e04698))
* retry cancelations
([#222](#222))
([3057474](3057474))


### Bug Fixes

* handle internal error: tck failure
([#186](#186))
([b55fbfd](b55fbfd))
* **sse:** support data: prefix without space
([#188](#188))
([6657a6d](6657a6d)),
closes [#162](#162)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

[Bug]: ParseDataStream should tolerate "data:" without space for compatibility

2 participants