Skip to content
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

Why is Postie sending queries to DHL when viewing an order in the CP? #128

Open
peteeveleigh opened this issue Apr 11, 2024 · 3 comments
Open
Labels

Comments

@peteeveleigh
Copy link

Question

When viewing a completed order in the CP it looks as if Postie is doing it's thing and sending a Payload to DHL. But why?
The order is completed, paid for, and to all intents and purposes finished with. There's no benefit to fetching shipping rates again.

The reason I ask is that we are seeing an intermittent problem viewing orders in the CP where an internal server error is thrown. The logged error is relating to Postie.

Error: Call to a member function getBody() on null in /home/forge/www.domain.com/vendor/verbb/postie/src/providers/DHLExpress.php:207

Additional context

No response

@engram-design
Copy link
Member

What version of Postie are you on? I can confirm this does happen, and I agree that it shouldn't, but it's a limitation of how Commerce's Vue-based order editor works. If people want to change the shipping method, using the dropdown won't work without a call to fetch available methods. What's frustrating is that the fetching of methods isn't even an Ajax request which we could check and allow for.

Looking into our options to improve this pretty detrimental performance hit.

As for the getBody() that line number doesn't match on my end, hence my version number question.

@peteeveleigh
Copy link
Author

Hi Josh

Looks like we are on version dev-craft-4
Probably as a result of an earlier issue and we haven't switched to a mainstream release. I'll switch to a proper release and see what happens.

The extra oddity is that this has only started happening in the last week or so which makes me think the root cause may be something else. Or perhaps DHL were having some issues and not sending a response sometimes.

@engram-design
Copy link
Member

I'm just assuming it's referring to this line

$data = Json::decode((string)$e->getResponse()->getBody());
which seems odd to throw that error, but not impossible.

But I agree this needs to be improved somehow, I'm just not sure what without adding more complexity to things like providing an entirely different interface to set the shipping methods that works with Postie. This isn't going to be great for UX though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants