Repository navigation
Conversation
This was referenced Oct 9, 2026
mroderick
force-pushed
the
fix/waiting-list-self-promotion-on-reject
branch
from
October 9, 2026 06:55
c4d1616 to
ac8fd0f
Compare
mroderick
marked this pull request as ready for review
October 9, 2026 06:55
WorkshopInvitationController#reject sets `attending: false` but leaves the member's WaitingList row in place. With the cancelling member's own entry first on the list, `WaitingList.next_spot` returns it for the seat they just freed: the flow destroys that entry, re-sets the freshly cancelled invitation to attending and emails the member they are attending again. Destroy the cancelling member's entry before looking up the next spot so the promotion goes to the real next entry for the role.
mroderick
force-pushed
the
fix/waiting-list-self-promotion-on-reject
branch
from
October 9, 2026 06:57
ac8fd0f to
f49cbcc
Compare
This branch has not been deployed
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.
Rejecting an RSVP while the member is themselves waitlisted can hand the seat back to the person who just cancelled. This PR removes the cancelling member's waiting-list entry during reject, so the promotion goes to the real next entry for the role.
One of five small PRs from the same pre-existing-gap audit against this flow (cross-role promotion pin, promotion email pin, remove-of-consumed-entry guard, token-only reject). Heads are reviewed independently; if a sibling merges first expect a trivial rebase, the branches touch different regions of the same spec file.
Detail
WorkshopInvitationController#rejectsetsattending: falsebut leaves the member'sWaitingListrow in place. Two consequences:(
WaitingList.next_spot(workshop, role)) returns it. The flow then destroys that entry, re-sets thefreshly cancelled invitation to
attending: true, and emails the member they are attending again —the self-promotion cascade.
Fix: destroy the cancelling member's entry (
WaitingList.find_by(...)&.destroy) before computing the next spot, so a rejection cannot list the member back in.Review notes
next_spotis computed; the third new spec (member behind is promoted, canceler not) exercises exactly that.attending: falsemembers can also hold waitlist entries (a member who joined the list then cancelled), so the lookup usesfind_bywithout an attending filter, same as the existing delete flow.promote_nextupdate-failure path, concurrency, and the promotion/freeze boundary — all owned byfeat/post-close-rsvp-waitlist(which renamesnext_spottopromote_next; the rule above carries over).Sibling PRs: