Claude Opus 5.5 · Heavy
fix-proper-handling-of-group-memberships-discourse-cursor
Discourse · Ruby · L · 300–799 lines · 6 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.
- Gold bugs found
- 3 of 10
- Comments published
- 4
- Comments matching a bug
- 3
- Comments not matching
- 1
- Cost of this PR
- $2.591
Published comments (4)
Public group members page shows only the first 50 members — `findMembers` sends the default `limit: 50` and `members.hbs` has no next/previous controls, so larger groups lose members the server used to return in full. Add pagination or infinite loading to the public members page.
Adding an existing member raises RecordNotUnique and aborts the batch — `users.push` violates the unique index on `group_users(group_id, user_id)`, so the request fails with a 500 (`RecordNotUnique`) and the remaining usernames are never added. Skip existing members, e.g. `next if group.users.exists?(user.id)`, before calling `group.add`.
remove_member spec sends PUT although the route is DELETE only — Controller specs skip verb routing, so this tests a request no client can send and misses the DELETE path the UI uses (`delete "members" => "groups#remove_member"`). Use `xhr :delete` to match the route and the sibling test.
totalPages overcounts by one when user_count is a multiple of limit — On the real last page `showingLast` is false, so `next` sets `offset` to `user_count` and loads an empty member list (e.g. 50 members with `limit` 50 gives 2 pages). Replace `Math.floor(user_count / limit) + 1` with `Math.ceil(user_count / limit)`.