Skip to content

fix(verify): confirm before revoking a ticket, naming the ticket and that it's permanent - #346

Merged
presidojay1 merged 2 commits into
StellarTickets:mainfrom
Derinsolababy:fix/246-confirm-revoke
Oct 16, 2026
Merged

presidojay1 merged 2 commits into
StellarTickets:mainfrom
Derinsolababy:fix/246-confirm-revoke

Conversation

@Derinsolababy

@Derinsolababy Derinsolababy commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On the Verify page (src/app/verify/page.tsx), the Revoke button called handleRevoke() directly. One click built the revoke transaction, asked the wallet to sign and submitted it, with no confirmation. #92 ("confirm before revoking a ticket") was closed, but no confirmation step ever existed in the code.

Revocation is permanent and on-chain: the ticket stops being valid for entry, check-in and resale. On a door-staff screen where Check in and Revoke sit side by side, one mis-tap on the wrong button, or on the wrong scanned ticket, destroys someone's valid ticket.

What changed

Commit 1: fix(verify)

  • Revoke now opens a confirmation instead of revoking. It reuses the shared ConfirmDialog added in feat(events): confirm on-chain publish in a ConfirmDialog that names the locked resale cap and royalty #343 (accessible alertdialog, focus starts on Cancel, Tab trapped, Escape/backdrop cancel, focus returned to the Revoke button on close). No new modal code.
  • The dialog names the ticket, so staff can catch a wrong scan before signing. Example:

    Summer Fest · VIP · Seat A12 · held by Ada Obi
    Revocation is recorded on-chain and can't be undone: the ticket will no longer be valid for entry, check-in or resale. Your wallet will ask you to sign.

  • Only "Revoke ticket" in the dialog calls handleRevoke(). That closes the dialog, then runs the existing revoke → sign → confirm-revoke flow unchanged. While it's in flight the dialog's buttons show Revoking… / disabled, and Escape is ignored.
  • New src/lib/revoke-confirm.ts: describeRevokeTarget() builds the ticket line from the verify result (eventName, tier, seat, ownerName), skipping blank fields instead of leaving dangling · separators.
  • Check-in is unchanged. It's reversible and is the normal high-frequency door action, so it stays one click.

Commit 2: test(verify), new src/lib/revoke-confirm.test.ts

  • Names the event, tier, seat and holder.
  • Skips blank seat/holder without empty separators.
  • Trims whitespace.

The dialog's own behaviour (only confirm calls onConfirm; Cancel/Escape cancel; Escape ignored while loading; focus on Cancel; Tab trap) is already covered by src/components/confirm-dialog.test.tsx, which passes on this branch.

Testing

npx vitest run src/lib/revoke-confirm.test.ts src/components/confirm-dialog.test.tsx
 Test Files  2 passed (2)
      Tests  10 passed (10)
  • npx eslint on the changed files: clean.
  • npx tsc --noEmit: no errors in the changed files. The only errors are the 4 TS18046 errors in src/lib/api-timeout.test.ts, which this PR doesn't touch.

Closes #246
Closes #247
Closes #248
Closes #249

Revoke ran the on-chain revocation as soon as the button was clicked.
The button now opens the shared ConfirmDialog, which names the ticket
(event, tier, seat, holder) and says revocation is permanent; the revoke
only runs from 'Revoke ticket'. Cancel, Escape or a backdrop click leave
the ticket untouched.

Closes StellarTickets#246
@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Derinsolababy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for stellartickets failed.

Name Link
🔨 Latest commit 6b9f948
🔍 Latest deploy log https://app.netlify.com/projects/stellartickets/deploys/6ad2a88ff050d9a375415178

@presidojay1
presidojay1 merged commit ebde507 into StellarTickets:main Oct 16, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants