Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/core/src/v3/apps/backoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ export class ExponentialBackoff {
elapsedMs += Date.now() - start;
clearTimeout(attemptTimeout);
}

if (elapsedMs > this.#maxElapsed * 1000) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The new maxElapsed break is unreachable on AttemptTimeout retries because continue in catch skips the post-finally check.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/src/v3/apps/backoff.ts, line 344:

<comment>The new `maxElapsed` break is unreachable on `AttemptTimeout` retries because `continue` in `catch` skips the post-`finally` check.</comment>

<file context>
@@ -340,6 +340,10 @@ export class ExponentialBackoff {
         clearTimeout(attemptTimeout);
       }
+
+      if (elapsedMs > this.#maxElapsed * 1000) {
+        break;
+      }
</file context>

break;
}
}

if (finalError instanceof AttemptTimeout) {
Expand Down
Loading