Skip to content

Commit ac4869d

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 89f2d43 commit ac4869d

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 (isClientError(e)) {
302302
throw e;
303303
}
304-
await backoffMachine.wait();
305304
}
305+
await backoffMachine.wait();
306306
}
307307
// Without this, Flow 0.92.1 does not know this code is unreachable,
308308
// and it incorrectly thinks Promise<undefined> could be returned,

0 commit comments

Comments
 (0)