Hey again all, sorry for another end-of-day issue ...
# pact-js
c
Hey again all, sorry for another end-of-day issue (and sorry for not providing more detail with it) but something is not quite right with
@pact-foundation/pact
version
9.18.1
. My provider tests are failing because the incoming request body is being mangled. Rather then sending through this:
Copy code
{
  "foo": "bar"
}
it's sending through this:
Copy code
{
  "{\"foo\":\"bar\"}": ""
}
This happens in
9.18.1
but not
9.17.3
. I have to stop for the day but I can provide more details on this tomorrow (including pacts and more detail on what versions are affected). I thought at least posting this might jog someone's memory about something
đź‘‹ 1
m
Thanks Cody. this, is strange indeed. I’ll check out the diff to see what could be different, but we have regression tests in both Pact JS and in the core that would include this in at least “normal” situations. So I wonder if there is an edge case we’re running into here
I’ll take a look after this call
This PR is the most likely candidate in the Pact JS side of things: https://github.com/pact-foundation/pact-js/pull/875/files
There is a middleware that listens to all provider requests, with the primary purpose of providing provider state middleware, and also “request filters” (the ability to modify requests prior to verification for certain cases)(
This PR added ability to modify the bodies, which includes consuming the incoming body, storing it aside, and then rehydrating it back in as if nothing happens. It certainly has the smell. This being said, there are integration tests that cover provider verification and request filters, so I would have thought that case would be picked up
c
hey @Matt (pactflow.io / pact-js / pact-go) thanks for having a look, I just got settled at my desk. What are some pieces of information that would be helpful to get to the bottom of this? I imagine: • Specific version where the break happens • Pact file which is being used by the provider • Sample HTTP requests from the pact verifier?
m
Hey Cody, apologies have been traveling to the states. I should get a good wifi this week to look into it.
Example pact file is all I should need. You've provided the version already. It shouldn't be hard to repro from there.
If you could please raise an issue on the GH repo for pact JS that would be great
c
Will do, thanks Matt!
I created this issue for the situation I am experiencing: https://github.com/pact-foundation/pact-js-core/issues/383
👍 1