From 6cfe729c9bd890a4f4745757dd798b4fc33ca314 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Mon, 22 Jun 2020 22:21:21 -0700 Subject: [PATCH] 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]: https://github.com/zulip/zulip-mobile/pull/4166#discussion_r442571600 --- src/message/fetchActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/message/fetchActions.js b/src/message/fetchActions.js index efddce93243..c58edd1f819 100644 --- a/src/message/fetchActions.js +++ b/src/message/fetchActions.js @@ -312,8 +312,8 @@ export async function tryFetch(func: () => Promise): Promise { if (isClientError(e)) { throw e; } - await backoffMachine.wait(); } + await backoffMachine.wait(); } // Without this, Flow 0.92.1 does not know this code is unreachable, // and it incorrectly thinks Promise could be returned,