Skip to content

Commit bb8e0c2

Browse files
leshniakclaude
andcommitted
fix: guard getRetryDelay against negative values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bf9cf5f commit bb8e0c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/OnyxUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ function wait(ms: number): Promise<void> {
798798
function getRetryDelay(attempt: number): number {
799799
const baseDelay = RETRY_BASE_DELAY_MS * 2 ** attempt;
800800
const jitter = baseDelay * RETRY_JITTER_FACTOR * (2 * Math.random() - 1);
801-
return Math.round(baseDelay + jitter);
801+
return Math.max(0, Math.round(baseDelay + jitter));
802802
}
803803

804804
function reportStorageQuota(error?: Error): Promise<void> {

0 commit comments

Comments
 (0)