From 154af1367a2183664708c65c30f8c8d9d37a114c Mon Sep 17 00:00:00 2001 From: zomars Date: Mon, 23 Oct 2023 13:15:43 -0700 Subject: [PATCH] hotfix: unreachable rate limits --- packages/lib/checkRateLimitAndThrowError.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/checkRateLimitAndThrowError.ts b/packages/lib/checkRateLimitAndThrowError.ts index 88c43f0230..d510a16181 100644 --- a/packages/lib/checkRateLimitAndThrowError.ts +++ b/packages/lib/checkRateLimitAndThrowError.ts @@ -9,7 +9,7 @@ export async function checkRateLimitAndThrowError({ }: RateLimitHelper) { const { remaining, reset } = await rateLimiter()({ rateLimitingType, identifier }); - if (remaining < 0) { + if (remaining < 1) { const convertToSeconds = (ms: number) => Math.floor(ms / 1000); const secondsToWait = convertToSeconds(reset - Date.now()); throw new TRPCError({