From 40e8f436e61a4341b360006421ded53a95afa055 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 2 Jan 2026 12:26:53 -0500 Subject: [PATCH] Avoid trusted seed retry blocking app startup --- js/bootstrap.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/js/bootstrap.js b/js/bootstrap.js index 9f1095eb..7ea9bc3a 100644 --- a/js/bootstrap.js +++ b/js/bootstrap.js @@ -144,18 +144,27 @@ async function bootstrapTrustedSeeds() { } }; - let hydrateResult = await hydrate(); + const hydrateResult = await hydrate(); + + const runAsyncRetry = async () => { + if (hydrateResult?.ok || attempts >= 2) { + return; + } - if (!hydrateResult?.ok && attempts < 2) { const relaysReady = await waitForRelaysReady(); if (relaysReady) { - hydrateResult = await hydrate(); + await hydrate(); } else { devLogger.warn( "[bootstrap] Skipping trusted seed retry because relays were not ready in time.", ); + applySeeds(); } - } + }; + + runAsyncRetry().catch((error) => { + userLogger.warn("[bootstrap] Trusted seed retry failed", error); + }); if (!hydrateResult?.ok) { applySeeds();