Skip to content

Fix [AlwaysPublishResponse] on remote request/reply#2301

Merged
jeremydmiller merged 1 commit intomainfrom
fix/2299-always-publish-response-remote
Mar 12, 2026
Merged

Fix [AlwaysPublishResponse] on remote request/reply#2301
jeremydmiller merged 1 commit intomainfrom
fix/2299-always-publish-response-remote

Conversation

@jeremydmiller
Copy link
Member

Summary

Closes #2299

  • [AlwaysPublishResponse] was silently ignored when a handler processed a message via remote request/reply (e.g., TCP, RabbitMQ). The response was sent back to the caller's ReplyUri but never published as a cascading message.
  • Root cause: remote request/reply hits the ReplyUri code path in EnqueueCascadingAsync which always returned after sending the reply, never checking if the response should also be published. The in-process path worked because it sets Envelope.ResponseType (a CLR Type not serializable over the wire).
  • Fix: added an explicit AlwaysPublishResponse flag on Envelope that the attribute's generated code sets. The ReplyUri code path now checks this flag and also publishes the response when true.

Test plan

  • New test always_publish_response_should_also_publish_on_remote_request_reply — verifies remote InvokeAsync<T> with [AlwaysPublishResponse] both returns the response AND publishes it
  • All 21 existing remote_invocation tests pass (no regressions)
  • All 18 TCP transport compliance tests pass (no regressions)

🤖 Generated with Claude Code

…2299)

The attribute only worked for in-process InvokeAsync<T> because that path
sets Envelope.ResponseType (a CLR Type not serializable over the wire).
Remote request/reply hits a different code path in EnqueueCascadingAsync
that sends the reply but never checks if the response should also be
published. Added an explicit AlwaysPublishResponse flag on Envelope that
the attribute sets, and check it in the ReplyUri code path.

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

[AlwaysPublishResponse] has no effect on remote request/reply

1 participant