Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
eslint: Fix unicorn/no-useless-recursion.
Anders Kaseorgee94fba49c86
diff --git a/web/src/peer_data.ts b/web/src/peer_data.tsindex ca5a46d500d..b8ba11c34cf 100644--- a/web/src/peer_data.ts+++ b/web/src/peer_data.ts@@ -78,21 +78,23 @@ const fetch_user_subscriptions_response_schema = z.object({// delay each time) if the server keeps returning non-400 errors.export async function fetch_stream_subscribers_with_retry(stream_id: number,- num_attempts = 1,): Promise<LazySet | null> {- const subscribers = await fetch_stream_subscribers(stream_id);- // Bad request, so just give up here.- if (subscribers === false) {- return null;- }- // Failed request, retry.- if (subscribers === null) {- num_attempts += 1;- const retry_delay_secs = get_retry_backoff_seconds(undefined, num_attempts);- await new Promise((resolve) => setTimeout(resolve, retry_delay_secs * 1000));- return fetch_stream_subscribers_with_retry(stream_id, num_attempts);+ let num_attempts = 1;+ while (true) {+ const subscribers = await fetch_stream_subscribers(stream_id);+ // Bad request, so just give up here.+ if (subscribers === false) {+ return null;+ }+ // Failed request, retry.+ if (subscribers === null) {+ num_attempts += 1;+ const retry_delay_secs = get_retry_backoff_seconds(undefined, num_attempts);+ await new Promise((resolve) => setTimeout(resolve, retry_delay_secs * 1000));+ continue;+ }+ return subscribers;}- return subscribers;}// This function either waits for an existing pending request or kicks off