Skip to content

fix(sse): skip empty keepalive events#1498

Open
agufagit wants to merge 1 commit into
wundergraph:masterfrom
agufagit:master
Open

fix(sse): skip empty keepalive events#1498
agufagit wants to merge 1 commit into
wundergraph:masterfrom
agufagit:master

Conversation

@agufagit

Copy link
Copy Markdown

Summary

  • skip empty SSE keepalive/comment events before forwarding to the GraphQL response parser
  • keep empty unnamed SSE events as unknown instead of treating them as completion
  • add coverage for comment keepalives, named empty events, and terminal complete events

Tests

  • go test ./pkg/engine/datasource/graphql_datasource/subscriptionclient/transport

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1c9643fe-435b-4dbf-aa1a-26ee2b260295

📥 Commits

Reviewing files that changed from the base of the PR and between b08f86e and 01fd2c0.

📒 Files selected for processing (2)
  • v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/transport/sse_conn.go
  • v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/transport/sse_conn_test.go

📝 Walkthrough

Walkthrough

This PR refines SSE connection handling in the GraphQL subscription client to filter empty keepalive events from reaching the downstream message parser, while preserving terminal complete events. The implementation also corrects the default message type for unknown events from Complete to Unknown. A test validates the filtering behavior.

Changes

SSE Keepalive Event Filtering

Layer / File(s) Summary
Event filtering and message type handling
v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/transport/sse_conn.go
The readLoop condition now skips empty events except terminal complete events, preventing keepalive comments from propagating downstream. The parseEvent default case returns MessageTypeUnknown instead of MessageTypeComplete for unknown event types with no data.
Keepalive filtering validation
v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/transport/sse_conn_test.go
New test subcase confirms that keepalive comment lines and empty SSE events are filtered out while valid next and complete events are delivered to the handler.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(sse): skip empty keepalive events' accurately and concisely describes the main change: filtering out empty SSE keepalive events before they reach the downstream GraphQL parser.
Description check ✅ Passed The description provides clear, related context about the changes: skipping empty SSE keepalive events, handling empty unnamed events as unknown rather than complete, and adding test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant