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

#75 Retry request on network failure #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bmxmale
Copy link

@bmxmale bmxmale commented Apr 19, 2021

No description provided.

@bmxmale bmxmale changed the title ISSUE-75 Retry request on network failure #75 Retry request on network failure Apr 19, 2021
$response = parent::__doRequest($request, $location, $action, $version, $one_way);
$response = parent::__doRequest($request, $location, $action, $version, $oneWay);
if (null === $response) {
return $this->__doRequest($request, $location, $action, $version, $oneWay);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may cause an infinite loop. It's better to throw an exception instead and let the application decide what to do next. @johnzuk I'd suggest to add 'exceptions' => true to default options here:

but that's a breaking change I guess.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure it can be like what - exception sound like best option here

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmxmale Also additional logic needs test coverage

@@ -4,9 +4,12 @@

class SoapClient extends \SoapClient
{
public function __doRequest($request, $location, $action, $version, $one_way = 0): string
public function __doRequest($request, $location, $action, $version, $oneWay = false): string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was historically named $one_way and the type should be int. It was changed in PHP 8 but we should support PHP 7.1+ https://www.php.net/manual/en/soapclient.dorequest.php#refsect1-soapclient.dorequest-changelog

@codecov-commenter
Copy link

Codecov Report

Merging #103 (003a740) into master (a9f777f) will decrease coverage by 0.18%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #103      +/-   ##
============================================
- Coverage     92.54%   92.35%   -0.19%     
- Complexity      188      189       +1     
============================================
  Files            31       31              
  Lines           456      458       +2     
============================================
+ Hits            422      423       +1     
- Misses           34       35       +1     
Impacted Files Coverage Δ Complexity Δ
src/GusApi/Client/SoapClient.php 80.00% <75.00%> (-20.00%) 2.00 <2.00> (+1.00) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9f777f...003a740. Read the comment docs.

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

Successfully merging this pull request may close these issues.

4 participants