Skip to content

[BUG] Free RSVP check-in always fails — checkInParticipant writes fields Firestore rules forbid #753

Description

@vipul674

Bug

checkInParticipant() in app/src/lib/checkInService.js runs a transaction that writes to the participant document:

```js
transaction.set(
participantRef,
{ checkInStatus: "checked-in", checkedInAt, checkedInBy: organizerId },
{ merge: true },
);
```

But firestore.rules for events/{eventId}/participants/{participantId} only allow a participant to update their own doc and only the keys `status`, `buddyPreference`, `updatedAt`:

```text
allow update: if request.auth != null && request.auth.uid == participantId &&
validateAttendanceStatus(request.resource.data) &&
request.resource.data.diff(resource.data).affectedKeys().hasOnly([`status`, `buddyPreference`, `updatedAt`]);
```

The check-in runs as the organizer (not the participant), and writes `checkInStatus` / `checkedInAt` / `checkedInBy` — both conditions fail. Because Firestore transactions are atomic, this one denied write fails the whole transaction, so `checkInParticipant` always returns `Check-in failed`.

Reproduction

  1. Create an event (free, no ticket).
  2. Attendee RSVPs (participant doc created).
  3. Organizer scans attendee QR → `QRScannerScreen.js:86` calls `checkInParticipant`.
  4. Check-in fails with `Unable to complete check-in` even though organizer owns the event.

Expected

Free-RSVP attendees can be checked in by the event owner/organizer.

Actual

Transaction denied by security rules; check-in always fails.

Suggested fix

Either allow the organizer (via `isEventOwner`) to update `checkInStatus`/checkedInAt\/checkedInBy\ on the participant doc, or route the participant status update through a Cloud Function (as is already done for volunteer logs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions