DeepSeek V4 Pro · 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 Opus 5.5.
- Gold bugs found
- 3 of 9
- Comments published
- 3
- Comments matching a bug
- 3
- Comments not matching
- 0
- Cost of this PR
- $0.567
Published comments (3)
allow_animation ignored for uploaded GIFs due to extensionless tempfile path — Animated GIF uploads lose all frames because `OptimizedImage.downsize` selects the gifsicle branch only for paths ending in `.GIF`, but `tempfile.path` is an extensionless Rack tempfile, so they fall into the first-frame-only `convert` path and are permanently flattened. Detect GIF-ness from the content type or `filename` instead of the tempfile path when passing `allow_animation`.
Duplicate downsize definition overrides 5-arg method causing ArgumentError — The duplicate `self.downsize` definition replaces the original, so the only 5-argument caller in `resize_emoji.rb` now raises `ArgumentError` (given 5, expected 3..4). Merge the signatures into a single method that accepts either a dimensions string or separate width and height arguments.
Client-side upload size check ignores per-type site settings — Hardcoding `maxSizeKB = 10 * 1024` bypasses the per-type site setting, so oversized avatars and non-image attachments pass the client check, upload fully, and fail server-side with a generic error instead of the friendly `file_too_large` alert. Restore the `Discourse.SiteSettings['max_' + type + '_size_kb']` lookup, or only apply the 10MB allowance when the image will be downsized.