Eddie Stanley
02/01/2023, 10:43 PMVerify
on our IPactVerifierSource
, we interop into the Rust code which actually verifies the interations. When verifying a given interaction, what is the sequence of events?
Specfically, my question is what happens if the interaction is missing the providerState
key - will it still call the provider states endpoint or will it skip that and go directly to making the request?
We're on version 4.1.0 of PactNet if it's relevant.Matt (pactflow.io / pact-js / pact-go)
Eddie Stanley
02/02/2023, 1:34 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Eddie Stanley
02/02/2023, 1:40 AMproviderState
key, the verifier was never calling the provider-state endpoint so our stubs didn't get reset - hence stubbing from checking the previous interaction could leak into the next interaction if the next interaction didn't set state itself.
We've fixed it for us by changing our middleware to reset the stubs at the end of executing a request that wasn't set-provider-state.
It might be better if the verifier always called the provider-state endpoint, even if the interaction doesn't specify a providerState key? It makes the reset/cleanup/set-state more explicit (rather than being done implicitly as a clean-up / finally
)Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Eddie Stanley
02/02/2023, 2:09 AM