Skip to content

fix: do not emit empty SSE event after comment when last id is sticky - #46

Open
ltsyk wants to merge 2 commits into
florimondmanca:masterfrom
ltsyk:fix/sse-comment-with-sticky-id
Open

fix: do not emit empty SSE event after comment when last id is sticky#46
ltsyk wants to merge 2 commits into
florimondmanca:masterfrom
ltsyk:fix/sse-comment-with-sticky-id

Conversation

@ltsyk

@ltsyk ltsyk commented Jul 30, 2026

Copy link
Copy Markdown

Summary

After an event with an id: field, a comment line (: ping) followed by a blank line incorrectly produced a phantom empty event. _last_event_id is sticky per the SSE spec and must not, by itself, trigger a dispatch.

Change

When handling a blank line, only consider _event, _data, and _retry as reasons to dispatch — not the sticky last event id.

Test plan

Fixes #35

@ltsyk

ltsyk commented Aug 1, 2026

Copy link
Copy Markdown
Author

Reformatted with black so the Azure Check job (black/ruff) matches the already-passing py39/py313 test jobs. Logic of the sticky last_event_id fix is unchanged.

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.

Incorrect comment parsing when using ids

1 participant