Allow registered participants to claim spots for guests#128
Merged
michaelchu merged 3 commits intomainfrom Mar 9, 2026
Merged
Conversation
Extend the claim-spots feature so any authenticated user who has joined an event can claim spots for others, not just the organizer. Adds an RLS policy that permits INSERT when the user is either the event organizer or an existing participant. The feature remains gated behind the guest_registration feature flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the claim-spots feature to allow any registered event participant (not just the event organizer) to claim empty spots for guests they're bringing. The feature remains gated behind the guest_registration feature flag.
Changes:
- Updated the
canUserClaimSpot()utility to accept a newisRegisteredparameter, allowing either organizers or registered participants to claim spots - Added a new Supabase RLS migration that replaces the organizer-only INSERT policy with one that permits inserts from any registered participant of the event
- Updated unit and integration tests to cover the new registered-participant claiming path
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
supabase/migrations/20260310000000_allow_participants_to_claim_spots.sql |
New migration that drops the organizer-only claim policy and creates a broader policy allowing registered participants to claim spots |
src/lib/utils.ts |
Added isRegistered parameter to canUserClaimSpot() with (isOrganizer || isRegistered) logic |
src/pages/EventDetailPage.tsx |
Passes isRegistered: !!userRegistration to canUserClaimSpot() call |
src/pages/__tests__/canUserClaimSpot.test.ts |
Updated unit tests with new base args and test cases for registered vs. unregistered users |
src/pages/__tests__/EventDetailPage.test.tsx |
Added integration test for non-organizer registered user seeing the Claim button; updated test name for unregistered user case |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
michaelchu
commented
Mar 9, 2026
Owner
Author
michaelchu
left a comment
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and CLAUDE.md compliance.
🤖 Generated with Claude Code
Enable the guest_registration feature flag per-user in E2E tests using the existing enableFeatureFlagForUser helper. Tests cover both organizer and registered non-organizer claiming spots for guests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isRegisteredparam tocanUserClaimSpot()— organizers OR registered participants can now claimguest_registrationfeature flagTest plan
canUserClaimSpotcover both organizer and registered-participant pathsguest_registrationis enabled🤖 Generated with Claude Code