Skip to content

Commit 04a0507

Browse files
committed
fetchActions: Pull await backoffMachine.wait() out of catch block.
As Greg points out [1], this makes the most sense conceptually; it's happening at the bottom of the loop, just before a new iteration starts. The `return` in the `try` block is enough to ensure that this wait won't interfere with a successful fetch. [1]: zulip#4166 (comment)
1 parent 83bd132 commit 04a0507

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/message/fetchActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ export async function tryFetch<T>(func: () => Promise<T>): Promise<T> {
301301
if (!isServerError(e)) {
302302
throw e;
303303
}
304-
await backoffMachine.wait();
305304
}
305+
await backoffMachine.wait();
306306
}
307307
})(),
308308
config.requestLongTimeoutMs,

0 commit comments

Comments
 (0)