From ac6e10cd344aa9005f6ada76d09e174fc2ea2836 Mon Sep 17 00:00:00 2001 From: Geoff Turk Date: Mon, 19 Oct 2026 18:24:11 +0200 Subject: [PATCH] fix(portal): show why adding a Keyring administrator failed vtafarm-api now ends a failed grant_acl request with the final status 'failed' and returns the reason in `error` (ic3software/vtafarm-api#89). The portal did not know the status, so the Keyring card fell through to "Generate a QR code when you are ready." and the user was never told the attempt had failed. Show the error instead, with a fallback when none is sent. Signed-off-by: Geoff Turk --- src/lib/api.ts | 2 +- src/pages/portal/SessionPnmCard.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/api.ts b/src/lib/api.ts index fa8a8dc..a36f67c 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -16,7 +16,7 @@ export const API_BASE: string = _apiUrl export interface MobileConnection { request_id: string - status: 'open' | 'claimed' | 'confirmed' | 'provisioning' | 'released' | 'rejected' | 'lapsed' + status: 'open' | 'claimed' | 'confirmed' | 'provisioning' | 'released' | 'rejected' | 'lapsed' | 'failed' vta_did: string operation: 'provision_vta' | 'grant_acl' expires_at: string diff --git a/src/pages/portal/SessionPnmCard.tsx b/src/pages/portal/SessionPnmCard.tsx index 4be8a49..208b380 100644 --- a/src/pages/portal/SessionPnmCard.tsx +++ b/src/pages/portal/SessionPnmCard.tsx @@ -252,6 +252,7 @@ export function SessionPnmCard({ sessionId, vtaDid, onVtaRestarted }: SessionPnm const automaticQr = method === 'automatic' && mobileRequest && ['open', 'lapsed'].includes(mobileRequest.status) && mobileRequest.vta_did === vtaDid && hasCurrentMobileQr && mobileSynchronized && online ? mobileQrPayload.value : null const automaticMessage = mobileRequest?.status === 'rejected' ? 'That claim was rejected. The candidate key was not added.' + : mobileRequest?.status === 'failed' ? mobileRequest.error ?? 'The administrator key could not be added. Generate a new QR code and try again.' : !mobileRequest || hiddenMobileExpired ? 'Generate a QR code when you are ready.' : mobileRequest.status === 'released' ? 'The administrator key is installed. Keyring can redeem the VTA hand-over.' : mobileRequest.status === 'claimed' ? 'A Keyring claimed this link. Compare the code on both screens before continuing.'