Skip to content

Fix signup count descriptions incorrectly including withdrawn/waitlisted signups#11703

Merged
nbudin merged 1 commit into
mainfrom
nbudin/issue8468
Jun 15, 2026
Merged

Fix signup count descriptions incorrectly including withdrawn/waitlisted signups#11703
nbudin merged 1 commit into
mainfrom
nbudin/issue8468

Conversation

@nbudin

@nbudin nbudin commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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 a state: filter, so withdrawn signups could bleed into the displayed totals depending on their remaining attributes. The fix is to always pass the relevant state: through to count_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_count itself was correct). Waitlisted signups have bucket_key: nil, so filtering by bucket_key: some_key never matched them. For single-bucket events this is fixed by dropping the unnecessary bucket filter; for multi-bucket events it's fixed by filtering on requested_bucket_key (where the waitlist preference actually lives) instead of bucket_key.

Changes

  • bucket_descriptions now passes state: to all count_data.count calls, preventing withdrawn signups from inflating totals
  • Single-bucket waitlisted: counts all waitlisted signups rather than filtering by bucket_key (which waitlisted signups never have)
  • Multi-bucket waitlisted: filters by requested_bucket_key instead of bucket_key for per-bucket breakdown
  • Extracted single_bucket_descriptions, multi_bucket_descriptions, and per_bucket_description private helpers to keep bucket_descriptions within complexity limits
  • Added SignupCountPresenterTest with 13 tests covering the fixed behavior

Testing

The new test suite covers confirmed counts, waitlist counts, has_waitlist?, and signups_description output for both single- and multi-bucket events, with explicit cases verifying withdrawn signups are excluded.

🤖 Generated with Claude Code

…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>
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
app/presenters/signup_count_presenter.rb 🟢 89.52% 🟢 91.07% 🟢 1.55%
test/presenters/signup_count_presenter_test.rb 🔴 0% 🟢 100% 🟢 100%
Overall Coverage 🟢 53.79% 🟢 53.91% 🟢 0.12%

Minimum allowed coverage is 0%, this run produced 53.91%

@nbudin nbudin marked this pull request as ready for review June 15, 2026 16:54
@nbudin nbudin added the bug label Jun 15, 2026
@nbudin nbudin merged commit 7dcadf8 into main Jun 15, 2026
25 checks passed
@nbudin nbudin deleted the nbudin/issue8468 branch June 15, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emails sent on player drop report the the wrong number of people on a waitlist.

1 participant