Closed aarmoa closed 1 year ago
Thanks for reporting this @aarmoa. It is definitely a bug in the implementation for moving window (across all storage types). I'll add some test cases for this scenario and try to address it by EOD.
This is resolved in master and will be available in the next release.
@aarmoa the fix is available in 3.1.6. Please close the issue once you've had a chance to verify.
Closing due to inactivity.
Hello limits team. I think there is a problem when the
hit
method is called passing a cost higher than the limit amount configured in the limit. I tested it with the following code:In the script the limit is created as 10 hits per minute. I first consume 5 with the first
hit
call and it returns True (as expected). Then I try to consume 100, that should not be permitted, and thehit
returns True again.The error that occurs is:
I have only reproduced the issue with
MovingWindowRateLimiter
, but think it might be happening for all storages (I reproduced the error both withMemoryStorage
and withRedisStorage
.