Claude Opus 5.5 · Balanced
fix-proper-handling-of-group-memberships-discourse-cursor
Discourse · Ruby · L · 300–799 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 3 of 10
- Comments published
- 3
- Comments matching a bug
- 3
- Comments not matching
- 0
- Cost of this PR
- $0.579
Published comments (3)
Public group members page shows only the first 50 members — `findMembers()` now uses the default `limit` of 50, but `group/members.hbs` has no pagination, so larger groups lose members that were previously listed. Add next/previous controls to the public page, or keep loading the full list for this route.
totalPages overcounts by one when user_count is a multiple of limit — With 50 members and a `limit` of 50, the UI shows "1/2" and `next` moves to an empty page at offset 50. Replace `Math.floor(user_count / limit) + 1` with `Math.ceil(user_count / limit)`.
Adding an existing group member raises RecordNotUnique and returns a 500 — `group.add(user)` inserts immediately, and the unique index on `group_users` `[group_id, user_id]` raises `ActiveRecord::RecordNotUnique`, leaving earlier usernames already inserted. Skip existing members, e.g. with `next if group.users.exists?(user.id)`.