Skip to content

Commit 77f2f06

Browse files
authored
Fix conditional logic for retry mechanism in jsclient.ts (#254)
Updated the conditional statement to ensure proper grouping and evaluate the timeout and no-responders error check accurately. This fixes a potential issue where retries may not trigger as intended. Signed-off-by: Alberto Ricart <[email protected]>
1 parent b6b9856 commit 77f2f06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jetstream/src/jsclient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ export class JetStreamClientImpl extends BaseApiClientImpl
226226
} catch (err) {
227227
const re = err instanceof RequestError ? err as RequestError : null;
228228
if (
229-
err instanceof errors.TimeoutError ||
230-
re?.isNoResponders() && i + 1 < retries
229+
(err instanceof errors.TimeoutError || re?.isNoResponders()) &&
230+
i + 1 < retries
231231
) {
232232
await delay(bo.backoff(i));
233233
} else {

0 commit comments

Comments
 (0)