From 668ed1590c6da2cf8e59b495860b4e5d0e8f0139 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 19 Apr 2026 04:47:44 -0400 Subject: [PATCH] feat(web5): surface multi-relay publish result on profile save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pairs with the backend change that broadcasts kind:0 to every enabled relay. Web5Identities.vue's publishProfile() now reads the richer response ({accepted, rejected, relays_attempted, published}) and shows one of three states: - all relays accepted → "Published to all N relays (event_id…)" - partial → "Published to X/N relays" plus a warning with the first relay's rejection reason - zero → "Published to 0/N relays — check Manage Relays" (error) User can now tell at a glance whether their profile actually made it to the wider nostr network or only the local relay. Co-Authored-By: Claude Opus 4.7 (1M context) --- neode-ui/src/views/web5/Web5Identities.vue | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/neode-ui/src/views/web5/Web5Identities.vue b/neode-ui/src/views/web5/Web5Identities.vue index 77a124a1..30b09c74 100644 --- a/neode-ui/src/views/web5/Web5Identities.vue +++ b/neode-ui/src/views/web5/Web5Identities.vue @@ -555,12 +555,29 @@ async function publishProfile() { method: 'identity.update-profile', params: { id: profileEditorIdentity.value.id, ...profileForm.value }, }) - const res = await rpcClient.call<{ event_id: string }>({ + const res = await rpcClient.call<{ + event_id: string + accepted: string[] + rejected: Array<[string, string]> + relays_attempted: number + published: boolean + }>({ method: 'identity.publish-profile', params: { id: profileEditorIdentity.value.id }, }) await loadIdentities() - profileSuccess.value = `Published to relay (${res.event_id.slice(0, 12)}...)` + const n = res.accepted?.length ?? 0 + const total = res.relays_attempted ?? 0 + const tail = `(${res.event_id.slice(0, 12)}…)` + if (n === total) { + profileSuccess.value = `Published to all ${total} relays ${tail}` + } else if (n > 0) { + profileSuccess.value = `Published to ${n}/${total} relays ${tail}` + const first = res.rejected?.[0] + if (first) profileError.value = `Rejected by ${first[0]}: ${first[1]}` + } else { + profileError.value = `Published to 0/${total} relays — check Manage Relays` + } setTimeout(() => { profileSuccess.value = '' }, 5000) } catch (err: unknown) { profileError.value = err instanceof Error ? err.message : 'Failed to publish'