Problem/Motivation
If we set the retry enabled to false in the settings UI, it has no effect. It still executes the retry.
Steps to reproduce
Just install the module and go to the system settings. Just disable the Enable retries setting. Then execute a client request that runs in an error.
Note: If you pass retry_enabled => FALSE to the options, it works.
Proposed resolution
In the class, src/HTTP/HttpClientMiddleware.php do not use the array_filter function. It filters all false values. But we want false here. The next line, then, sets the value to true.
We have PHP 8.1 in place in our installation.
I will provide a patch.
Issue fork http_client_retry-3358215
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
danielspeicher commentedComment #4
wellsHm yes I can see how
array_filtercauses an issue here. However we can't just remove it becauseNULLs in the default config will inadvertently override defaults in the client. We need a solution here booleans but filtersNULLs, I think?Comment #5
danielspeicher commentedYes, you are right. I will provide a solution.
Comment #6
danielspeicher commentedI have added a function to filter just
nullvalues.Comment #7
wellsComment #8
danielspeicher commentedShorthand function added.
Comment #9
wellsComment #10
danielspeicher commentedThen I need help. My
phpcsis clean with official Drupal profile.Let us save time and effort, so I propose, that you resolve this open thread.
Comment #11
wells@danielspeicher you may want to inspect your phpcs config. Here is the output from your branch:
Anyway yeah I'll put in a quick fix for this before merge. Thank you!
Comment #13
wellsComment #14
danielspeicher commentedThank you very much. I will check our config.