Fix duplicate fault response on the error path #1192 - #1193
Merged
andersjonsson merged 2 commits intoSep 11, 2026
Merged
Conversation
Collaborator
|
Great! Thank you! Will make a new release shortly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1192.
Change
The
catchinProcessMessageis removed, andIMessageInspector2.BeforeSendReplyis invoked from thecatchinProcessOperation, on the message that is written to the response.The correlation objects are created in
ProcessMessage, soProcessOperationcreates the list and passes it in.AfterReceiveRequeststays inside theISoapMessageProcessorpipe, andProcessMessageis private, so no public API is affected. The list is cleared once the inspectors have seen the reply, so a failure later in the response path cannot notify them a second time.Measured
Repro from the issue, single POST to an operation that throws:
v1.2.1.15Errorentries "An error occurred processing the message"IFaultExceptionTransformer.ProvideFaultinvocationsIMessageInspector2.AfterReceiveRequestinvocationsIMessageInspector2.BeforeSendReplyinvocationsBeforeSendReplypresent in the fault received by the clientAdjacent paths
AfterReceiveRequestAfterReceiveRequestISoapMessageProcessorswallows the exception and returns its own messageBeforeSendReplyTests
src/SoapCore.Tests/DuplicateFaultruns aTestServerwith a countingIFaultExceptionTransformer, anIMessageInspector2that stamps a header onto the reply, and anILoggerProviderthat recordsErrorentries. One faulting request asserts the rows of the table above. A fifth test asserts that a successful operation followed by a throwingIAsyncMessageFilter.OnResponseExecutingnotifies the inspectors once.Three of the five fail on
develop.Note
dotnet test src/SoapCore.Tests: 292 of 293 pass.TestIssue1183fails ondevelopas well.