Skip to content

Fix Ranks group pages crashing when the group has members - #109

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/rank-group-page
Oct 7, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/rank-group-page

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Opening a group in the staff panel's Ranks tab (for example /admin/ranks/groups/staff) showed "This page couldn't load".

GET /admin/luckperms/groups/{name} returned its member list straight from mirror.search_users, so the rows had no groups or rank. The member list on the page reuses PlayerResults, which calls row.groups.map(...), so any group with members threw on the client. The existing frontend test used an empty member list, so it never hit this.

  • The backend now fills member rows the same way as GET /admin/luckperms/players, through one shared helper.
  • Backend test: the staff group's members carry their groups and rank. It fails without the fix (KeyError: 'rank').
  • Frontend test: the group page fixture now has a member, and the test checks that it is listed.

Reproduced against the dev site's real staff payload before the fix.

🤖 Generated with Claude Code

The group detail endpoint returned its member list straight from
search_users, without the per-player groups and rank that the players
listing adds. The shared PlayerResults list maps over row.groups, so any
group with members crashed the page on the client ("This page couldn't
load"). Both endpoints now fill the rows in the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36693104-87a5-41f3-93a8-3a2b63f60cbf
📥 Commits

Reviewing files that changed from the base of the PR and between fdbfd58 and 1481fe1.

📒 Files selected for processing (3)
  • backend/src/luckperms/test_luckperms.py
  • backend/src/luckperms/views.py
  • frontend/app/components/admin/ranks/RanksOverview.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Staff group details now show each member’s rank and associated group membership, including for AdminMC and RootMC.
    • Rank and group information is consistently included in user listings, making these details available across both views.

Walkthrough

The backend now adds group and rank data to group-detail members and uses the same helper for user rows. Tests check staff group details and the display of a member in the ranks overview.

Changes

Rank group members

Layer / File(s) Summary
Member group and rank enrichment
backend/src/luckperms/views.py, backend/src/luckperms/test_luckperms.py
group_detail and users use _add_ranks to populate member group and rank data. The staff group detail test checks that AdminMC and RootMC have rank staff and include staff in their group lists.
Ranks overview member display
frontend/app/components/admin/ranks/RanksOverview.test.tsx
The test fixture includes Bob as a group member and checks that he appears in the Members region.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 1481f

Group-detail members now include the groups and rank fields needed by the Ranks panel, and the endpoint test checks that response. No actionable merge risk was identified.

Architecture Summary

Architecture risk: 🟡 Medium · up to 1481f

The change affects 2 systems.

Changed systems: backend, frontend

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — backend (service) was modified; 2 changed files map to changed impact.
  • observed — frontend (ui) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in backend/src/luckperms/test_luckperms.py: Added assertions that the staff group detail lists AdminMC and RootMC with rank staff, and that both members’ group lists include staff.
  • observed — Modified behavior in backend/src/luckperms/views.py: group_detail now enriches its member listing with group and rank data via _add_ranks.
  • observed — Modified behavior in backend/src/luckperms/views.py: Adds _add_ranks, which fills each listed player’s groups from positive, active group nodes, retaining contexts and expiry, and sets their rank using the loaded groups.
  • observed — Modified behavior in backend/src/luckperms/views.py: users now delegates row enrichment to _add_ranks after loading groups; this replaces the inline loop that populated groups and rank.

Reliability and maintainability

  • inferred — Risk-relevant change factors for backend: blast_radius_1; direct_dependents_1
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@ryanbarlow97
ryanbarlow97 merged commit fa996c1 into main Oct 7, 2026
2 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/rank-group-page branch October 7, 2026 15:48
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