Skip to content

fix: correct InspectGuest interface and remove render crash#90

Merged
jfurfaro merged 1 commit intomainfrom
fix/inspect-crash
Mar 15, 2026
Merged

fix: correct InspectGuest interface and remove render crash#90
jfurfaro merged 1 commit intomainfrom
fix/inspect-crash

Conversation

@jfurfaro
Copy link
Copy Markdown
Member

Summary

  • Updated InspectGuest interface to accurately reflect the API response (added id, eventId, eventDate, eventStatus; made createdReason optional; typed checkInTime as string | null)
  • Removed meta: { comment?: string } from the interface and destructuring (not returned by the API)
  • Removed the Notes row that rendered meta?.comment
  • Added checkInTime null guard before calling format(new Date(checkInTime), ...)

Why

The Inspect page crashed on every QR scan. Root cause: meta and created were declared in the interface but meta was never returned by the API, so meta?.comment silently rendered nothing — but created being absent meant format(new Date(undefined)) threw during render, propagating past the .catch() and hitting the ErrorBoundary.

Depends on mustachebash/api#121 which adds created to the /v1/inspect response.

Test plan

  • Scan a valid guest QR on the Inspect page — guest info renders correctly, no crash
  • Checked-in guest shows check-in time; unchecked guest shows status string
  • Scan an unknown QR — "Guest not found" message (no crash)
  • npm test passes in admin/

🤖 Generated with Claude Code

- Updated InspectGuest to match actual API response (added missing fields,
  removed non-existent meta field)
- Removed Notes row that referenced meta.comment (not in API response)
- Added null guard on checkInTime before formatting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jfurfaro jfurfaro merged commit e13bafd into main Mar 15, 2026
1 check passed
@jfurfaro jfurfaro deleted the fix/inspect-crash branch March 15, 2026 22:29
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.

1 participant