From af816c61a58641dea1bf3d8c900e4d0678ff38c3 Mon Sep 17 00:00:00 2001 From: archipelago Date: Fri, 19 Jun 2026 16:42:06 -0400 Subject: [PATCH] fix(ui): reliable federation-join feedback (90s timeout + re-check + success) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Joining a Fedimint federation is heavy and routinely outlasts the default 15s client timeout while still succeeding server-side, so the UI wrongly showed failure. Bump the join timeout to 90s, and on any error re-check the list: if a new federation appeared the join worked — show 'Federation joined.' instead of a misleading error. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/components/WalletSettingsModal.vue | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/neode-ui/src/components/WalletSettingsModal.vue b/neode-ui/src/components/WalletSettingsModal.vue index d3e54397..a9559b46 100644 --- a/neode-ui/src/components/WalletSettingsModal.vue +++ b/neode-ui/src/components/WalletSettingsModal.vue @@ -120,6 +120,7 @@
{{ fedError }}
+
Federation joined.
@@ -178,6 +179,7 @@ const federations = ref([]) const inviteCode = ref('') const joiningFed = ref(false) const fedError = ref('') +const fedJoinedOk = ref(false) watch( () => props.show, @@ -259,18 +261,36 @@ async function loadFederations() { async function joinFederation() { if (!fedimintBackendReady || !inviteCode.value.trim()) return + const before = federations.value.length joiningFed.value = true fedError.value = '' + fedJoinedOk.value = false try { await rpcClient.call<{ federation_id: string }>({ method: 'wallet.fedimint-join', params: { invite_code: inviteCode.value.trim() }, + // Joining a federation is heavy (downloads the federation config + joins + // the consensus); it routinely takes longer than the default 15s. Give it + // headroom past the backend's own 60s clientd timeout. + timeout: 90000, }) inviteCode.value = '' await loadFederations() + fedJoinedOk.value = true emit('changed') } catch (err: unknown) { - fedError.value = err instanceof Error ? err.message : 'Failed to join federation' + // A slow join often still completes server-side after the client gives up, + // so don't cry failure blindly — re-check the list. If a new federation + // appeared, the join actually worked; surface success instead of a scary + // (and wrong) timeout error. + await loadFederations() + if (federations.value.length > before) { + inviteCode.value = '' + fedJoinedOk.value = true + emit('changed') + } else { + fedError.value = err instanceof Error ? err.message : 'Failed to join federation' + } } finally { joiningFed.value = false }