-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SaveUnmatchedRequests stopped working #1001
Comments
@LevYas Can you please test preview version 1.5.35-ci-17786 ? |
Thank you for such a quick reaction! I installed this version via MyGet feed, but the error is still reproducible. I'm not sure that the problem is exactly in the line I mentioned - I meant that the match structure/logic might be changed, but I'm not sure. Does your unit test pass without the modification to the condition line? I don't see the logic changes, for me, it does the same. Is it possible that an exception is thrown in the request logging? Json serialization in this method can throw. Not in this line, but if I start debugging with "just my code" disabled, I get JSON serialization error:
In that moment, current string in the json parser is
This happens at the initialization stage:
My mapping
|
I think I got it. The JSON serialization exception is thrown here
Stack trace
That is why we never reach the WriteUnmatchedRequest. The exceptions itself is quite strange:
Probably that happened when the serializer tried to serialize BodyAsMimeMessage. |
Thank you for the analysis. MimeMessage support is fairly new. However you are not using any Multiparty Mine, correct? I'll try to use your mapping and debug the code. Btw thank you for the sponsoring. |
UR welcome, happy to help. My pleasure! |
@LevYas |
That worked, thank you! WriteUnmatchedRequest was called and the file with failed matching is recorded successfully. |
PR is merged and I'll create a new NuGet version. |
Hi! Glad to see the project is thriving! I noticed a little side-effect though :)
Describe the bug
Unmatched requests are no longer saved
Expected behavior:
They should be
Test to reproduce
Other related info
This doesn't work on the latest version 1.5.35, but I see many changes published on Aug 3. I tried to downgrade to version 1.5.32 and it works in 1.5.32, but doesn't work in 1.5.34 and 1.5.35.
The function WriteUnmatchedRequest is not even called in the latest versions. I tested this using my file handler:
If I downgrade to 1.5.32 the breakpoint does hit and the file is successfully saved.
Maybe something has changed in the way the condition is calculated here
WireMock.Net/src/WireMock.Net/Owin/WireMockMiddleware.cs
Lines 190 to 191 in 59aab9e
The text was updated successfully, but these errors were encountered: