Skip to content

[sse] Preserve data beginning with a colon - #597

Open
bensynapse wants to merge 1 commit into
jetify-com:mainfrom
bensynapse:fix-sse-colon-data
Open

bensynapse wants to merge 1 commit into
jetify-com:mainfrom
bensynapse:fix-sse-colon-data

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

Summary

data: :hello\n\n currently decodes to an event with nil data. The encoder can emit this payload, so text round trips lose it too.

Parse every dispatched data buffer. Actual comment lines are already skipped before field parsing.
The tests cover both separator forms, a lone colon, multiline data with comments and metadata, consecutive events, and text round trips.

How was it tested?

All eight new regression cases fail with the original decoder.
go test -race -cover -v ./sse/... passes on Go 1.27.1 with 94.5% library coverage.
The SSE suite also passes on Go 1.24.2 with 94.4% coverage.
Configured golangci-lint run and golangci-lint fmt --diff pass for the SSE module. Vet and example builds pass.

I ran the monorepo plugin's Go commands across all seven workspace modules on Go 1.27.1.
The race suite passes all 1,703 test and subtest markers with one existing skip. All module builds pass.
The full formatter and lint runners stop at three formatting findings in unchanged envsec/pkg/envcli files.
Both runners produce identical findings on untouched main with the same tooling.

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers under the terms of the Apache 2 License.

I represent that I have the right to license these contributions to the project maintainers under the Apache 2 License.
This follows the Community Contribution License.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant