Skip to content

fix(samples): filter out heartbeat messages from webhook stream UI#198

Open
pengying wants to merge 1 commit into02-12-feat_adding_typescript_samplefrom
02-12-fix_hide_heartbeat_from_webhooks
Open

fix(samples): filter out heartbeat messages from webhook stream UI#198
pengying wants to merge 1 commit into02-12-feat_adding_typescript_samplefrom
02-12-fix_hide_heartbeat_from_webhooks

Conversation

@pengying
Copy link
Contributor

@pengying pengying commented Feb 14, 2026

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Ignore heartbeat messages in the webhook stream event handler to prevent them from being processed as regular webhook events.

@pengying pengying marked this pull request as ready for review February 14, 2026 00:15
Copy link
Contributor Author

pengying commented Feb 14, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 14, 2026

Greptile Summary

This PR filters out heartbeat messages from the SSE stream to prevent them from being displayed as webhook events in the UI. The backend sends data: heartbeat\n\n every 30 seconds to keep the SSE connection alive (index.ts:74), and the frontend now properly ignores these by checking if the raw data equals 'heartbeat' before processing. Additionally, the catch block now silently skips non-JSON messages instead of adding them as raw events.

Changes:

  • Added early return for empty or heartbeat messages before JSON parsing
  • Removed the catch block logic that was adding unparseable messages as raw events
  • Cleaned up error handling to align with the heartbeat filtering approach

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple, focused fix that filters heartbeat messages from the UI. The logic is sound: it checks for heartbeat strings before JSON parsing, preventing them from appearing as events. The implementation aligns correctly with the backend's heartbeat sending mechanism (every 30 seconds). No logic errors, security issues, or breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
samples/frontend/src/components/WebhookStream.tsx Filters heartbeat messages from SSE stream to prevent display as webhook events

Last reviewed commit: 5dc3954

@pengying pengying force-pushed the 02-12-feat_adding_typescript_sample branch 2 times, most recently from 62f02be to bb08f69 Compare February 18, 2026 18:50
@pengying pengying force-pushed the 02-12-fix_hide_heartbeat_from_webhooks branch from 853a262 to 39d7789 Compare February 18, 2026 18:50
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pengying pengying force-pushed the 02-12-fix_hide_heartbeat_from_webhooks branch from 39d7789 to 5dc3954 Compare February 19, 2026 00:07
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

Comments