Skip to content

Conversation

@Button99
Copy link
Contributor

This PR ensures that remaining() and retriesLeft() in the CacheLimiter will never return negative values when the attempt counter exceeds the allowed attempts.

When the rate limit counter exceeds the maxAttempts the calculation $maxAttempts - $attempts can be a negative number. The solution uses max(0, $maxAttempts - $attempts) to clamp the result to 0.

@taylorotwell taylorotwell merged commit b7267f2 into laravel:12.x Nov 21, 2025
76 checks passed
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.

2 participants