Skip to content

fix(triple): allow unary handlers to set response metadata#3446

Open
Alanxtl wants to merge 1 commit into
apache:developfrom
Alanxtl:codex/fix-triple-unary-response-metadata
Open

fix(triple): allow unary handlers to set response metadata#3446
Alanxtl wants to merge 1 commit into
apache:developfrom
Alanxtl:codex/fix-triple-unary-response-metadata

Conversation

@Alanxtl

@Alanxtl Alanxtl commented Jun 19, 2026

Copy link
Copy Markdown
Member

What changed

  • Store the unary handler connection in the handler context before invoking user logic.
  • Add a regression test that calls triple.SetHeader and triple.SetTrailer from a unary handler and verifies the client receives both values.

Why

SetHeader and SetTrailer require handlerOutgoingKey{} in the handler context to access the current StreamingHandlerConn. The unary handler path only injected incoming metadata, so generated unary service implementations could not use the documented response metadata APIs.

Closes #3444.

Validation

go test ./protocol/triple/triple_protocol -run TestSetHeaderAndSetTrailerInUnaryHandler -count=1
go test ./protocol/triple/triple_protocol
go test ./protocol/triple

@sonarqubecloud

Copy link
Copy Markdown

@Alanxtl Alanxtl added ☢️ Bug 3.3.2 version 3.3.2 labels Jun 19, 2026
@Alanxtl Alanxtl marked this pull request as ready for review June 19, 2026 08:44
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.65%. Comparing base (60d1c2a) to head (9d4daaa).
⚠️ Report is 852 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3446      +/-   ##
===========================================
+ Coverage    46.76%   53.65%   +6.88%     
===========================================
  Files          295      493     +198     
  Lines        17172    38421   +21249     
===========================================
+ Hits          8031    20613   +12582     
- Misses        8287    16147    +7860     
- Partials       854     1661     +807     

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.3.2 version 3.3.2 ☢️ Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][Triple] Generated Triple unary handlers cannot use SetHeader/SetTrailer

2 participants