Hi folks, appreciate any help. Already have BDCT s...
# pactflow
d
Hi folks, appreciate any help. Already have BDCT setup using Pactflow. Now I'm currently setting up MBCT but it looks like its trying to send http requests like for a normal provider verification.
Copy code
2025-06-20T09:55:08.050264Z  INFO ThreadId(16) pact_verifier: Running setup provider state change handler with empty state for 'a setCurrentPage event with empty pageId'
2025-06-20T09:55:08.050280Z  INFO ThreadId(16) pact_verifier: Running provider verification for 'a setCurrentPage event with empty pageId'
2025-06-20T09:55:08.050295Z  INFO ThreadId(16) pact_verifier::provider_client: Sending request to provider at <http://localhost:56254/>
2025-06-20T09:55:08.050300Z  INFO ThreadId(16) pact_verifier::provider_client: Sending request HTTP Request ( method: POST, path: /, query: None, headers: Some({"Content-Type": ["application/json"]}), body: Present(58 bytes, application/json) )
[10:55:08.052] ERROR (8141): pact@15.0.1: no handler found for message a setCurrentPage event with empty pageId
Pactfile - https://pastebin.com/zqtfunst Consumer - https://pastebin.com/8MqM3Sre Provider - https://pastebin.com/fNTH9cSc My consumer tests will pass, generate the pactfile, it looks correct But on running the provider tests using jest it seems to use default http verifier
m
MBCT?
Looking at https://pastebin.com/fNTH9cSc, it’s just regular message pact. in case it’s not clear, we don’t currently have BDCT for message pact
That being said, you seem to have a handler setup for
a setCurrentPage event with empty pageId
so … it looks OK to my eyes 🤔
d
Sorry for the confusion - BDCT is separate, we have that implemented using OAS. This issue is focused on Message Based Contract Testing - I have a MFE with events
m
no probs!
d
m
The way it works behind the scenes, is that we spin up an HTTP proxy server to receive events from the FFI subsystem (which actually does all of the logic) - because we need to effectively execute JS code, we do that through this intermediary. So the HTTP stuff you see in (unfortunately) INFO level logs, is no surprises a bit confusing
d
ah ok so it might not be the issue
m
shouldn’t be
this is just local for now, right? i.e. you’re just manually pointing to the generated message pact file?
any chance you could please provide DEBUG level logs? Something NQR obviously
d
I thought it was just local for now because I'm passing pactUrls to the provider and not brokerToken or brokerUrl but noticed this in logs. So maybe there's some version mismatching going on. I'll get the debug logs and try updating the pact file on the broker
Copy code
The pact at <https://g-p.pactflow.io/pacts/provider/dynamic-forms-ui-provider/consumer/dynamic-forms-test-consumer/pact-version/9c03a14753f62693b5734fb618f907c95bfe4c68> is being verified because the pact content belongs to the consumer version matching the following criterion:
    * latest version of dynamic-forms-test-consumer that has a pact with dynamic-forms-ui-provider (0.0.1)
m
interesting
you might have
PACT_BROKER_xyz
env vars in your environment - just check if they’ve been cleared
d
oh that could be it. I have the token and broker url as env vars in my shell
No luck so far unfortunately, here's the output of the provider tests - https://pastebin.com/yWKdJyfY
m
hmmm
I don’t think it’s the problem, but i note your tests have metadata on them
(actually you don’t, that’s a default - nvm)
I might need to review with fresh eyes. i can’t see why it can’t find the handlers!
(at least the ones that are defined, anyway)
d
Yeah me neither. It's probably some small config issue. Let me know if you need anymore info or if a screen-share call would help. And thanks again for the help!!
m
A small repro code base would be ideal I think at this point David
Once we have one of those, it should be pretty quick to narrow d own
d
Please see https://github.com/davidmck95/pactflow I'm free for a call too if that would help
m
Ah, I might have needed to be clearer here - a repro would be some code I can execute (i.e. a minimal example that shows the problem). See howtorepro
m
But, I noticed you did have multiple provider pacts: •
formStateUpdate.provider.pact.ts
•
etCurrentPage.provider.pact.ts
and •
setFormValues.provider.pact.ts
It looks like you’re trying to split the tests across these three files? I think that’s the problem - each
MessageProviderPact
is trying to verify all of the interactions in the pact file. I suspect this might be part of the problem?
d
Hi Matt. The repo provided should have everything we need no? Not sure what else I could add. I tried using just one provider - no difference
m
What I mean is, the repo isn’t executable. I can’t run the tests, for example because it relies on libraries and probably other parts of your code that aren’t present Ideally, you have an example consumer and provider that reproduces the exact issue you have (without your specific IP/code etc.). Once we get to that minimal example, we can more quickly hone in on the issue.
d
Hi Matt. Just fyi, the issue seemed to be having multiple MessageProviderPacts. However, I tried editing them to use different providers and I still got the same issue. In the end I just have all tests in the one file for my Message Contract Testing. Not sure if this is by design or a potential room for improvement. But thanks for all your help, much appreciated
m
Hmm no reason why it shouldn't work across multiple providers, assuming each contract targets a different one. But I can see why it wouldn't work with three separate provider tests