fix: 96 DPI is accepted as the Site shows it; big carts upload 4 at a time (Sentry 12/11)

The server compared the raw lowest resolution (95,6) with 96 but printed
it rounded, refusing '96 DPI abaixo do mínimo de 96'; it now decides on the
same rounded value the Site shows. A big cart started every upload at once
and hit the limit of 10 pending uploads (429): the limit is 30, that
refusal carries Retry-After so the Site retries by itself, and the Site
runs at most 4 uploads at a time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-12 09:38:51 -03:00
parent d3918e83dc
commit 31776ca353
8 changed files with 76 additions and 12 deletions

View File

@@ -217,10 +217,12 @@ def resolution_issue(files, items, rows):
dpis.append(dpi)
if not dpis:
continue
lowest = min(dpis)
if lowest < DPI_REFUSE:
return f'Item {index}: resolução de {js_round(lowest)} DPI abaixo do mínimo de {DPI_REFUSE} DPI.'
if lowest < DPI_IDEAL and (item['quality_status'] != 'warning' or not item['quality_acknowledged']):
# The Site shows and compares the rounded DPI (web/site-quality.js,
# site-pdf.js): decide on the same whole number, not the raw fraction.
shown = js_round(min(dpis))
if shown < DPI_REFUSE:
return f'Item {index}: resolução de {shown} DPI abaixo do mínimo de {DPI_REFUSE} DPI.'
if shown < DPI_IDEAL and (item['quality_status'] != 'warning' or not item['quality_acknowledged']):
return f'Item {index}: confirme a ressalva de resolução entre {DPI_REFUSE} e {DPI_IDEAL - 1} DPI.'
return None