Skip to content

Commit 81d1ffa

Browse files
[APP-9296] Do not attempt retries when closed (#626)
1 parent d7b732e commit 81d1ffa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/robot/client.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ export class RobotClient extends EventDispatcher implements Robot {
326326

327327
this.currentRetryAttempt = attemptNumber;
328328

329-
// Always retry the next attempt
330-
return true;
329+
// Always retry the next attempt if not closed
330+
return !this.closed;
331331
},
332332
};
333333

@@ -568,8 +568,10 @@ export class RobotClient extends EventDispatcher implements Robot {
568568

569569
this.currentRetryAttempt = attemptNumber;
570570

571-
// Abort reconnects if the the caller specifies, otherwise retry
572-
return !conf.reconnectAbortSignal?.abort;
571+
const aborted = conf.reconnectAbortSignal?.abort ?? false;
572+
573+
// Retry if not closed or aborted
574+
return !aborted && !this.closed;
573575
},
574576
};
575577

0 commit comments

Comments
 (0)