Skip to content

Conversation

@zbchi
Copy link
Contributor

@zbchi zbchi commented Oct 28, 2025

Fix: Replace panic with a logged internal error in compatUnaryServerInterceptor, when a service returns (nil, nil)
or a non-*RPCResult type.

Why this is needed

Previously, such invalid responses caused the server goroutine to panic.
This change ensures the error is properly logged and returned to the client instead
Related to #3008

@AlexStocks AlexStocks requested a review from Copilot October 28, 2025 12:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error handling in the compatUnaryServerInterceptor by replacing panics with proper error logging and returning errors to clients when services return invalid responses ((nil, nil) or non-*RPCResult types).

Key changes:

  • Added logger import for error logging
  • Replaced panic with logged error and proper error response for nil response/nil error case
  • Replaced panic with logged error and proper error response for non-RPCResult type case

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.33%. Comparing base (60d1c2a) to head (2d87c85).
⚠️ Report is 646 commits behind head on develop.

Files with missing lines Patch % Lines
protocol/triple/triple_protocol/handler_compat.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3064      +/-   ##
===========================================
- Coverage    46.76%   40.33%   -6.44%     
===========================================
  Files          295      457     +162     
  Lines        17172    32425   +15253     
===========================================
+ Hits          8031    13078    +5047     
- Misses        8287    18085    +9798     
- Partials       854     1262     +408     

☔ 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.

@zbchi zbchi force-pushed the fix-handler-compat-panic branch 2 times, most recently from e9cca22 to 7b21b77 Compare October 28, 2025 14:36
@zbchi zbchi force-pushed the fix-handler-compat-panic branch from 7b21b77 to 2d87c85 Compare October 28, 2025 14:48
@sonarqubecloud
Copy link

Copy link
Contributor

@Alanxtl Alanxtl left a comment

Choose a reason for hiding this comment

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

lgtm

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.

3 participants