From 8845cd3e23730346899b60256dcaca00678bf131 Mon Sep 17 00:00:00 2001 From: JonPurvis Date: Sun, 22 Mar 2026 23:40:00 +0000 Subject: [PATCH 1/2] retry via connector when rate limit sleep follows manual exceed --- src/Traits/HasRateLimits.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Traits/HasRateLimits.php b/src/Traits/HasRateLimits.php index b19279e..eba3f7d 100644 --- a/src/Traits/HasRateLimits.php +++ b/src/Traits/HasRateLimits.php @@ -92,15 +92,18 @@ public function bootHasRateLimits(PendingRequest $pendingRequest): void // place. We should make sure to throw the exception here. if (isset($limitThatWasExceeded)) { - if (! $limit->getShouldSleep()) { + if (! $limitThatWasExceeded->getShouldSleep()) { $this->throwLimitException($limitThatWasExceeded); } // When the limit has been instructed to sleep() we will make the request // again, which will trigger the request middleware to sleep, and then // hopefully get a successful response afterward. + // + // Always delegate to the connector: send() exists on Connector but not on Request + // (see saloonphp/saloon#532). - return $this->send($response->getRequest()); + return $response->getConnector()->send($response->getRequest()); } return $response; From cc7e2f373a73976468719f6140db4823a12cf4aa Mon Sep 17 00:00:00 2001 From: JonPurvis Date: Mon, 23 Mar 2026 00:13:18 +0000 Subject: [PATCH 2/2] rerun tests