Claude Sonnet 5.5 · Balanced
feature-automatically-downsize-large-images-discourse-cursor
Discourse · Ruby · S · 30–99 lines · 3 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 3 of 8
- Comments published
- 3
- Comments matching a bug
- 3
- Comments not matching
- 0
- Cost of this PR
- $0.241
Published comments (3)
`downsize` is defined twice, so the second definition replaces the first — `Jobs::ResizeEmoji` still calls `OptimizedImage.downsize` with five arguments, so every emoji resize job now raises `ArgumentError`. Remove the duplicate and update the `Jobs::ResizeEmoji` call to pass "100x100", or keep one method that accepts both forms.
Hard-coded 10MB upload limit overrides max_attachment_size_kb for attachments — The hard-coded 10MB limit ignores `max_attachment_size_kb`, so the browser blocks valid attachments above 10MB and lets oversized ones through below it. Apply the 10MB cap only when `type === 'image'`, keep the site setting for attachments, and fix the 413 handler the same way.
Image downsize loop ignores failures and passes a percentage to gifsicle — With `allow_animation: true`, GIFs go to `gifsicle --resize-fit 80%`, which expects WxH, so the command likely fails. `OptimizedImage.downsize` then returns false, the loop ignores it, and oversized GIFs are never shrunk after 5 wasted attempts.