Fix signup count descriptions incorrectly including withdrawn/waitlisted signups#11703
Merged
Conversation
…incorrectly The bucket_descriptions method in SignupCountPresenter was not passing a state filter when summing counts, causing withdrawn signups to be included in the confirmed/waitlisted totals shown in withdrawal notification emails. Also fixes a pre-existing bug where waitlisted signups always showed a count of 0 in signups_description: for single-bucket events we no longer filter by bucket_key unnecessarily; for multi-bucket events we now filter by requested_bucket_key rather than bucket_key, which waitlisted signups do not have set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
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.
Purpose
Fixes #8468 (and a family of related reports going back years). When a player withdrew from an event, the notification email sent to GMs reported the wrong waitlist/signup counts.
The root cause was in
SignupCountPresenter#bucket_descriptions: it was summing counts without astate:filter, so withdrawn signups could bleed into the displayed totals depending on their remaining attributes. The fix is to always pass the relevantstate:through tocount_data.count.While investigating, I also found a pre-existing bug where waitlisted signups always showed a count of 0 in the description text (even though
waitlist_countitself was correct). Waitlisted signups havebucket_key: nil, so filtering bybucket_key: some_keynever matched them. For single-bucket events this is fixed by dropping the unnecessary bucket filter; for multi-bucket events it's fixed by filtering onrequested_bucket_key(where the waitlist preference actually lives) instead ofbucket_key.Changes
bucket_descriptionsnow passesstate:to allcount_data.countcalls, preventing withdrawn signups from inflating totalsbucket_key(which waitlisted signups never have)requested_bucket_keyinstead ofbucket_keyfor per-bucket breakdownsingle_bucket_descriptions,multi_bucket_descriptions, andper_bucket_descriptionprivate helpers to keepbucket_descriptionswithin complexity limitsSignupCountPresenterTestwith 13 tests covering the fixed behaviorTesting
The new test suite covers confirmed counts, waitlist counts,
has_waitlist?, andsignups_descriptionoutput for both single- and multi-bucket events, with explicit cases verifying withdrawn signups are excluded.🤖 Generated with Claude Code