fix(activities): surface statsError on the door-scanner page #89

Merged
padreug merged 1 commit from fix/scanner-stats-error-banner into dev 2026-06-04 09:49:39 +00:00
Owner

Summary

useTicketScanner already captures the stats fetch error into a ref but ScanTicketsPage never read it, so a 404 / 403 / auth failure on GET /tickets/event/{id}/stats was completely silent — the counts strip kept showing the last good value while scans landed on the backend, making it look like the scanner was broken when actually the refresh path was just dead.

Adds a small destructive-toned banner under the counts strip, visible across both Scanner and Scanned tabs.

  • AlertCircle already imported
  • No new composable surface — statsError is already exported from useTicketScanner
  • 17 lines added; no logic changes

Context

Surfaced during a live test on aio-demo on 2026-06-03: the events backend was missing the /stats endpoint (now shipped in aiolabs/events signer-abstraction at 1.6.1-aio.5), and the scanner page silently froze its counts strip on 0 SCANNED even though /register/{ticket_id} was succeeding. With this banner the failure would have been visible immediately rather than read as a "scanner is broken" bug.

Test plan

  • Build cleanly (build:activities) — vue-tsc ran clean locally
  • On staging (demo.aiolabs.dev): load /events/.../scan on an event the wallet owns — no banner should appear (happy path)
  • Force a failure by visiting the scan page with a wallet that doesn't own the event — banner should render with the 403 message
  • Once events 1.6.1-aio.5 is on aio-demo, confirm scanner counts now move post-scan and banner stays hidden

🤖 Generated with Claude Code

## Summary `useTicketScanner` already captures the stats fetch error into a ref but `ScanTicketsPage` never read it, so a 404 / 403 / auth failure on `GET /tickets/event/{id}/stats` was completely silent — the counts strip kept showing the last good value while scans landed on the backend, making it look like the scanner was broken when actually the refresh path was just dead. Adds a small destructive-toned banner under the counts strip, visible across both Scanner and Scanned tabs. - `AlertCircle` already imported - No new composable surface — `statsError` is already exported from `useTicketScanner` - 17 lines added; no logic changes ## Context Surfaced during a live test on aio-demo on 2026-06-03: the events backend was missing the `/stats` endpoint (now shipped in `aiolabs/events` `signer-abstraction` at `1.6.1-aio.5`), and the scanner page silently froze its counts strip on `0 SCANNED` even though `/register/{ticket_id}` was succeeding. With this banner the failure would have been visible immediately rather than read as a "scanner is broken" bug. ## Test plan - [ ] Build cleanly (`build:activities`) — `vue-tsc` ran clean locally - [ ] On staging (`demo.aiolabs.dev`): load `/events/.../scan` on an event the wallet owns — no banner should appear (happy path) - [ ] Force a failure by visiting the scan page with a wallet that doesn't own the event — banner should render with the 403 message - [ ] Once events `1.6.1-aio.5` is on aio-demo, confirm scanner counts now move post-scan and banner stays hidden 🤖 Generated with [Claude Code](https://claude.com/claude-code)
useTicketScanner already captures the stats fetch error into a ref
but ScanTicketsPage never read it, so a 404 / 403 / auth failure on
GET /tickets/event/{id}/stats was completely silent — the counts
strip kept showing the last good value while scans landed on the
backend, making it look like the scanner was broken when actually
the refresh path was just dead.

Adds a small destructive-toned banner under the counts strip,
visible across both Scanner and Scanned tabs. AlertCircle already
imported. No new composable surface — statsError is already exported
from useTicketScanner.

Surfaced by a missing /stats endpoint on aio-demo's events backend
(now shipped as events 1.6.1-aio.5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
padreug deleted branch fix/scanner-stats-error-banner 2026-06-04 09:49:40 +00:00
Sign in to join this conversation.
No description provided.