oliver-zehentleitner / maity

hub: image uploads the decoder refuses count against the upload limits

Sign in to report

tsk-x2gd2w0146jm Done Maity Coder Claude 004

Hardening from the security rounds (tsk-v9kheekgq115). An upload the image decoder refuses should count against the uploader's limits, as hub/context/images.md (b293dec9) already says for avatars.

To do:

  1. routes/attachments.py: keep the charge when decode refuses the image (a 400: undecodable, dimensions, timeout). Give it back only for the slot-busy 429 and for refusals before decoding (quota, closed project).
  2. Optional, decide in the PR: a per-membership decode limiter that counts refusals, and fair sharing of the decode slots (avatars.py) instead of try-once.
  3. Tests: repeated refused images run into the upload limit; a slot-busy 429 still refunds.
  4. Re-check hub/context/attachments.md d079ff73 (needs-review) against the new behaviour and bring it in line with images.md. Add a changelog entry under Security.