From f9f120f397fc79d48784fe38426bc77b08a509c4 Mon Sep 17 00:00:00 2001 From: archipelago Date: Tue, 14 Jul 2026 06:34:33 -0400 Subject: [PATCH] fix(ui): Invite a Peer sends trust_level=observer to federation.invite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The invite type chosen in QuickActions was only used for the modal title — the RPC never carried it, so every invite was minted Trusted. Pass it through so 'Invite a Peer' mints observer invites and 'Link Your Nodes' keeps trusted ones. Co-Authored-By: Claude Fable 5 --- neode-ui/src/api/rpc-client.ts | 6 ++++-- neode-ui/src/views/Federation.vue | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/neode-ui/src/api/rpc-client.ts b/neode-ui/src/api/rpc-client.ts index aafcd79a..3735d153 100644 --- a/neode-ui/src/api/rpc-client.ts +++ b/neode-ui/src/api/rpc-client.ts @@ -668,10 +668,12 @@ class RPCClient { } // Federation - async federationInvite(): Promise<{ code: string; did: string; onion: string }> { + async federationInvite( + trustLevel: 'trusted' | 'observer' = 'trusted' + ): Promise<{ code: string; did: string; onion: string; trust_level: string }> { return this.call({ method: 'federation.invite', - params: {}, + params: { trust_level: trustLevel }, }) } diff --git a/neode-ui/src/views/Federation.vue b/neode-ui/src/views/Federation.vue index badb1de5..c7d0af6d 100644 --- a/neode-ui/src/views/Federation.vue +++ b/neode-ui/src/views/Federation.vue @@ -400,7 +400,9 @@ async function generateInvite() { try { generatingInvite.value = true error.value = '' - const result = await rpcClient.federationInvite() + // The invite type is not cosmetic: it sets the trust level the invite + // grants both sides ("Invite a Peer" = observer, "Link Your Nodes" = trusted) + const result = await rpcClient.federationInvite(inviteType.value) inviteCode.value = result.code } catch (e) { error.value = e instanceof Error ? e.message : 'Failed to generate invite'