saloonphp / saloon

🤠 Build beautiful API integrations and SDKs with Saloon
https://docs.saloon.dev
MIT License
2.09k stars 107 forks source link

Fix exponential backoff attribute #342

Closed boryn closed 11 months ago

boryn commented 11 months ago

$useExponentialBackoff needs to be defined as null, as otherwise when $useExponentialBackoff is only specified at the connector level, this line:

$useExponentialBackoff = $request->useExponentialBackoff ?? $this->useExponentialBackoff ?? false;

will evaluate false, as it has default false value for the request class (inherited from HasTries trait)

Sammyjo20 commented 11 months ago

Thanks @boryn!

boryn commented 11 months ago

PS. It's a breaking change between 3.3.0 and 3.3.1. If somebody already defined public bool $useExponentialBackoff in connector / request it will demand a slight change in the definition to (nullable ?bool): public ?bool $useExponentialBackoff

Sammyjo20 commented 11 months ago

Oh, whoops. Really sorry I didn’t notice that @boryn. I’ll add it to the release notes but it could be considered a hotfix for the recent release.