Skip to content

Commit 30e1f3b

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 180bbd9 commit 30e1f3b

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
@@ -258,8 +258,8 @@ export async function tryFetch<T>(func: () => Promise<T>): Promise<T> {
258258
if (isClientError(e)) {
259259
throw e;
260260
}
261-
await backoffMachine.wait();
262261
}
262+
await backoffMachine.wait();
263263
}
264264
// Without this, Flow 0.92.1 does not know this code is unreachable,
265265
// and it incorrectly thinks Promise<undefined> could be returned,

0 commit comments

Comments
 (0)