Repository navigation
Conversation
This was referenced Oct 9, 2026
WaitingListsController#destroy calls destroy on WaitingList.find_by(invitation_id: @invitation.id), which is nil when the entry no longer exists. The case is reachable by replaying a stale Remove-from-the-waiting-list link (double-click, or a bookmarked token URL after the entry was consumed), and currently renders a 500. Guard the lookup: redirect with a notice when the entry is gone, and record no waiting_list.left activity.
mroderick
force-pushed
the
fix/waiting-list-destroy-missing-entry
branch
from
October 9, 2026 06:55
d1fbd40 to
2834634
Compare
mroderick
marked this pull request as ready for review
October 9, 2026 06:58
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.
Removing a waiting-list entry that no longer exists rendered a 500. This PR guards the lookup in
WaitingListsController#destroyand redirects with a notice instead.One of five small PRs from the same pre-existing-gap audit against this flow. Heads are reviewed independently; if a sibling merges first expect a trivial rebase, the branches touch different regions of the same spec files.
Detail
WaitingListsController#destroycalls.destroyonWaitingList.find_by(invitation_id: @invitation.id), which is nil when the entry is already gone — reachable by replaying a "Remove from the waiting list" link (double-click, or a bookmarked token URL after the entry was consumed by a promotion). A consumed entry is more likely after the promotion fix lands, since promotions destroy the next entry in the reject flow.Now: no entry means redirect to the invitation page with notice "You are not on the waiting list", and no
waiting_list.leftactivity recorded.Review notes
invitation_id, which carries the invitation token: the token is still the only credential, unchanged.Sibling PRs: