Skip to content

fix(portal): show why adding a Keyring administrator failed - #110

Merged
vthwang merged 1 commit into
mainfrom
fix/keyring-failed-grant-message
Oct 21, 2026
Merged

vthwang merged 1 commit into
mainfrom
fix/keyring-failed-grant-message

Conversation

@geoffturk

Copy link
Copy Markdown
Member

Companion to ic3software/vtafarm-api#89.

Background

On staging, linking the existing VTA gt to Keyring returned 409 on every "Generate new QR code" click. The investigation (see ic3software/vtafarm-api#89) found two ways a session could get permanently stuck: legacy reservation rows the API no longer recognized, and failed additional-administrator grants that never reached a final status. The API fix makes a failed grant_acl request end as failed, with the reason in error.

The portal didn't know the failed status. It degraded safely: the "Generate new QR code" button still showed. But the Keyring card fell through to the generic "Generate a QR code when you are ready.", so after scanning, confirming the code and waiting, the user was never told the attempt had failed.

Changes

  • src/lib/api.ts: add 'failed' to MobileConnection['status'] (also used by the pool view's claim_state).
  • src/pages/portal/SessionPnmCard.tsx: for a failed reservation, show the API's error ("Unable to add this administrator. Generate a new QR code and try again."), falling back to "The administrator key could not be added. Generate a new QR code and try again." when none is sent. It sits next to the rejected branch, ahead of the generic fallback that used to swallow it.

Testing

tsc -b and eslint pass on the changed files. Not exercised in a browser: showing the message needs a failed grant against an API that includes #89. Against an API without #89, nothing changes, since it never sends 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 <geoff@ic3.dev>
@geoffturk
geoffturk requested a review from vthwang October 19, 2026 16:25
@vthwang
vthwang merged commit dc759c5 into main Oct 21, 2026
1 check passed
@vthwang
vthwang deleted the fix/keyring-failed-grant-message branch October 21, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants