Skip to content

Conversation

@nbudin
Copy link
Contributor

@nbudin nbudin commented Jan 14, 2026

Fixes #11154.

Summary

  • Fixes EventVacancyFillService to process waitlisted signups in strict order
  • Adds test coverage for the bug where later waitlisted signups could be moved before earlier ones
  • Adds clarifying comments to explain the accommodation strategies

Changes

Bug Fix

The main issue was that the service would find any signup that could fill a vacancy, potentially skipping over earlier waitlisted people. The fix ensures waitlisted signups are processed in order and tries multiple strategies to accommodate each one:

  1. Direct fill: Can they fill the vacancy directly?
  2. Make room in their requested bucket: Use the current vacancy to make room in the bucket they want
  3. Create room if they want this full bucket: Find another bucket to move someone to, creating space

Documentation

Added comments to try_make_room_in_requested_bucket and try_make_room_for_waitlisted_signup to clarify their distinct purposes:

  • try_make_room_in_requested_bucket: Uses an existing vacancy to help waitlisted signups who want different buckets
  • try_make_room_for_waitlisted_signup: Creates a vacancy when the target bucket is full by finding a third bucket

Test plan

  • Test added demonstrating the bug and verifying the fix
  • Existing tests pass

🤖 Generated with Claude Code

nbudin and others added 4 commits January 8, 2026 09:13
When a vacancy opens in a bucket, the service now tries harder to
accommodate waitlisted signups in strict chronological order. If the
first person on the waitlist wants a different bucket that's full,
the service will move a no-preference signup to an alternate bucket
to make room, rather than skipping to the next person on the waitlist.

This ensures fairness by respecting the order people joined the waitlist,
even when their preferred bucket requires shuffling other signups.

Fixes #11154

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added comments to try_make_room_in_requested_bucket and
try_make_room_for_waitlisted_signup to clarify their distinct purposes:
- try_make_room_in_requested_bucket uses an existing vacancy to help
  waitlisted signups who want different buckets
- try_make_room_for_waitlisted_signup creates a vacancy when the target
  bucket is full

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Code Coverage Report: Only Changed Files listed

Package Coverage
Overall Coverage 🟢 56.51%

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Event vacancy pull doesn't try hard enough to maintain waitlist order

2 participants