Skip to content

Fix lust assignment bugs causing teams to be silently dropped#12

Merged
devi4nt merged 1 commit into
mainfrom
fix/lust-assignment-bugs
Mar 30, 2026
Merged

Fix lust assignment bugs causing teams to be silently dropped#12
devi4nt merged 1 commit into
mainfrom
fix/lust-assignment-bugs

Conversation

@devi4nt
Copy link
Copy Markdown
Owner

@devi4nt devi4nt commented Mar 30, 2026

Summary

  • Captain + lust same-role collision: when a healer captain was present (including stale captain: true flags persisted in session storage), the lust fallback forced a same-role healer provider onto the team, giving it 6 members instead of 5 — silently dropped by the length === 5 check
  • Multi-spec lust provider bugs: players with multiple specs could appear on multiple teams via stale entries in availableLustProviders, and selecting their DPS entry would deplete the healer pool (via pruneWorkingMembers removing all entries by name+realm)
  • Stale captain visibility: enabled captain logging so unexpected captains from session storage are surfaced in the console

Changes

  • Remove the lust fallback that assigned a conflicting same-role provider (providerIndex = 0 when findIndex returned -1)
  • Deduplicate availableLustProviders by player using a Map keyed on name-realm, preferring healer entries so lust fills both the lust and healer slot
  • Uncomment captain console.log to help identify stale captain flags

Test plan

  • New test: captain + all-healer lust providers produces correct team count (repeats: 10)
  • New test: multi-spec lust player doesn't deplete healer pool or duplicate across teams (repeats: 25)
  • All 32 existing + new tests pass

🤖 Generated with Claude Code

When a healer captain was present (including stale captain flags persisted
in session storage), the lust fallback could assign a same-role healer
provider, giving the team 6 members instead of 5 and causing it to fail
the length check silently. Additionally, multi-spec lust players could
appear on multiple teams due to stale entries in the providers list, and
their DPS entry being selected could deplete the healer pool.

- Remove lust fallback that forced conflicting same-role providers
- Deduplicate lust providers by player, preferring healer entries to
  prevent healer pool depletion with multi-spec selections
- Enable captain logging to surface stale captain flags from session storage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mythic-plus-team-randomiser with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8df20e7
Status: ✅  Deploy successful!
Preview URL: https://fc2373b0.mythic-plus-team-randomiser.pages.dev
Branch Preview URL: https://fix-lust-assignment-bugs.mythic-plus-team-randomiser.pages.dev

View logs

@devi4nt devi4nt merged commit 74024d0 into main Mar 30, 2026
2 checks passed
@devi4nt devi4nt deleted the fix/lust-assignment-bugs branch April 29, 2026 20:26
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.

1 participant