DeepSeek V4 Pro · 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 Opus 5.5.
- Gold bugs found
- 4 of 13
- Comments published
- 6
- Comments matching a bug
- 4
- Comments not matching
- 2
- Cost of this PR
- $1.617
Published comments (6)
add_members and remove_member read missing :group_id param — These routes expose the id as `params[:id]`, not `params[:group_id]`, so every add/remove request raises `ActionController::ParameterMissing` and returns 400. Read `params[:id]` like `update` and `destroy` do. **Also found in:** - `app/controllers/admin/groups_controller.rb:85-85`
add_members re-adds existing members causing RecordNotUnique — Re-adding an existing member hits the unique `(group_id, user_id)` index and returns a 500 instead of succeeding silently. Skip usernames that are already members before calling `group.add`.
Reset group members offset after deleting last member on page — The stored `offset` can point past the last member after a delete, so `findMembers()` requests an empty page while members exist on the previous one. Clamp the offset before reloading.
Default 50 member limit truncates public group member lists — Any public group over 50 members is silently truncated because the endpoint now paginates by default and the public template has no pager. Add pagination to the public page or fetch all members for that consumer.
Use DELETE verb in remove_member spec — Controller specs bypass routing, so this would still pass if the DELETE route broke or was removed. Use `xhr :delete` to match the endpoint defined in `config/routes.rb`.
totalPages overcounts pages when user_count is an exact multiple of limit — This reports an extra empty page whenever `user_count` is an exact multiple of `limit`, so `next` can navigate past the last member. Use `Math.ceil(user_count / limit)` instead.