Skip to content

feat: WebSocket server send error callback#427

Merged
tigrannajaryan merged 7 commits into
open-telemetry:mainfrom
observIQ:dakotapaasman/server-send-errors
Aug 12, 2025
Merged

feat: WebSocket server send error callback#427
tigrannajaryan merged 7 commits into
open-telemetry:mainfrom
observIQ:dakotapaasman/server-send-errors

Conversation

@dpaasman00

@dpaasman00 dpaasman00 commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

This PR adds functionality to the loop responsible for reading messages from the WebSocket connection to exit if we fail to send a message over the connection. This would trigger a reconnect from the client. Additionally it adds a new callback, OnMessageResponseError, that can be called in this event. This would follow behavior present when we fail to read from the connection.

Resolves #426

@dpaasman00
dpaasman00 requested a review from a team as a code owner July 31, 2025 17:32
@codecov

codecov Bot commented Jul 31, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c8e143c). Learn more about missing BASE report.
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
internal/wsmessage.go 66.66% 3 Missing ⚠️
server/serverimpl.go 62.50% 2 Missing and 1 partial ⚠️
server/types/callbacks.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #427   +/-   ##
=======================================
  Coverage        ?   80.16%           
=======================================
  Files           ?       27           
  Lines           ?     2591           
  Branches        ?        0           
=======================================
  Hits            ?     2077           
  Misses          ?      396           
  Partials        ?      118           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tigrannajaryan

Copy link
Copy Markdown
Member

The change makes sense to me. Can you add a test that verifies the new behavior (close on send error) and the new callback?

@dpaasman00

Copy link
Copy Markdown
Contributor Author

@tigrannajaryan I've added the test you asked for, should be ready.

@tigrannajaryan
tigrannajaryan merged commit c3f8082 into open-telemetry:main Aug 12, 2025
11 checks passed
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.

WS server should break out of loop when send fails

2 participants