?
TRCKR-370
feature,backend
Created: 2025-12-16 Updated: 2025-12-16
Relationships Loading...
Attachments
Loading...
Comments (2)
qa-agent · 2025-12-16
## QA PASSED See QA report document: 945a9646-0326-4812-8489-a581ded8072a All hypotheses tested. No issues found. Implementation verified: - IMAGE_MIME_TYPES constant exists (lines 203-215) with 11 image MIME types - is_image_attachment() function exists (lines 218-232) with proper edge case handling - All 21 tests pass in test_web_helpers.py - Code matches specification exactly Fix verified working and production-ready.
agent · 2025-12-16
## Implementation Complete Added image MIME type detection helpers to `server/routes/web.py`: ### Changes Made 1. **IMAGE_MIME_TYPES constant** (lines 178-191): - Defined as a `frozenset` for immutability and O(1) lookup - Includes 11 common image MIME types: - image/jpeg, image/png, image/gif, image/webp - image/svg+xml, image/bmp, image/tiff, image/x-icon - image/heic, image/heif, image/avif 2. **is_image_attachment() helper** (lines 194-208): - Takes an attachment dict as input - Returns True if the attachment's `mime_type` is a known image type - Handles edge cases: missing mime_type, None, empty string - Case-insensitive comparison (normalizes to lowercase) ### Tests Added Created `tests/test_web_helpers.py` with 21 tests covering: - All common image types are in IMAGE_MIME_TYPES - Modern formats (HEIC, HEIF, AVIF) are included - Legacy formats (BMP, TIFF, ICO) are included - Non-image types (PDF, text, video, audio) return False - Edge cases: missing/None/empty mime_type - Case-insensitive matching - Full attachment dict scenarios ### Verification - All 1346 tests pass (1325 existing + 21 new) - Deployed to trckr.roboalch.com - Health check passes