From 890a80da4878bd9bcb390367df7ce177d616a87c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Jan 2026 14:25:56 +0000 Subject: [PATCH] fix(retry): use literal values in retryConfigs to fix ESM initialization Hardcode values in retryConfigs.rsocket instead of referencing RETRY_BACKOFF_DELAYS and RETRY_JITTER_FACTOR to avoid "Cannot access before initialization" error in ESM module loading. --- src/Utils/retry-utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Utils/retry-utils.ts b/src/Utils/retry-utils.ts index 61affb88..672f0838 100644 --- a/src/Utils/retry-utils.ts +++ b/src/Utils/retry-utils.ts @@ -656,14 +656,14 @@ export const retryConfigs = { /** * RSocket-style retry with stepped delays * Uses fixed delay array: 1s, 2s, 5s, 10s, 20s (with ±15% jitter) - * Unlike exponential, this uses exact delays from RETRY_BACKOFF_DELAYS + * Values hardcoded to avoid initialization order issues in ESM */ rsocket: { - maxAttempts: RETRY_BACKOFF_DELAYS.length, - baseDelay: RETRY_BACKOFF_DELAYS[0], - maxDelay: RETRY_BACKOFF_DELAYS[RETRY_BACKOFF_DELAYS.length - 1], + maxAttempts: 5, // RETRY_BACKOFF_DELAYS.length + baseDelay: 1000, // RETRY_BACKOFF_DELAYS[0] + maxDelay: 20000, // RETRY_BACKOFF_DELAYS[4] backoffStrategy: 'stepped' as const, - jitter: RETRY_JITTER_FACTOR, + jitter: 0.15, // RETRY_JITTER_FACTOR }, }