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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 Overview

Greptile Summary

Filters out heartbeat messages from the SSE stream to prevent them from being displayed as webhook events in the UI.

  • Added early return when event.data === 'heartbeat' before JSON parsing
  • Prevents heartbeat messages (sent every 30 seconds by the TypeScript backend at samples/typescript/src/index.ts:74) from triggering the catch block or appearing as raw events
  • Change is correctly placed before the JSON.parse attempt to avoid parsing errors

Confidence Score: 5/5

  • Safe to merge - simple, focused bug fix with no side effects
  • Single-line defensive check that correctly filters out heartbeat messages before any processing occurs. The change is minimal, well-placed, and solves the exact problem described in the PR without introducing any new risks or edge cases.
  • No files require special attention

Important Files Changed

Filename Overview
samples/frontend/src/components/WebhookStream.tsx Added early return to filter out heartbeat messages before JSON parsing, preventing them from appearing as events in the UI

Last reviewed commit: 853a262

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