Claude Sonnet 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.350
Published comments (3)
Group members page only loads the first 50 members with no paging — `model.findMembers()` runs once with the default limit of 50, and the `group/members.hbs` template has no paging controls, so larger groups silently show only 50 members. Add pagination to the public members view, or request a limit that covers the whole group.
totalPages overcounts by one when user_count is a multiple of limit — When `user_count` is an exact multiple of `limit`, `totalPages` counts an extra page, so `showingLast` stays false on the real last page and 'next' loads an empty page. Use `Math.ceil(user_count / limit)`.
Unbounded limit and negative offset in group members endpoint — `limit` comes straight from `params[:limit].to_i`, so a huge value serializes an entire large group in one request and a negative value causes a database error. Clamp `limit` between 1 and 200, and use `[offset, 0].max` for `offset`.