Convert Telegram HEIC uploads to JPEG before storage#405
Conversation
EXIF saleStart is still read from the original buffer in createMomentsFromGroup; only the stored asset is normalized to image/jpeg so downstream consumers avoid HEIC decoding. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesHEIC photo upload handling
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/lib/telegram/chat/__tests__/uploadPhotoAttachment.heic.test.tsOops! Something went wrong! :( ESLint: 9.39.4 TypeError: Converting circular structure to JSON ... [truncated 446 characters] ... c/dist/eslintrc.cjs:3261:25) src/lib/telegram/chat/uploadPhotoAttachment.tsOops! Something went wrong! :( ESLint: 9.39.4 TypeError: Converting circular structure to JSON ... [truncated 446 characters] ... c/dist/eslintrc.cjs:3261:25) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
uploadPhotoAttachmentand decode to JPEG via the sharedprepareImageBufferForSharphelper before Supabase upload.image/jpegfor new Telegram moments.saleStartextraction increateMomentsFromGroupis unchanged — it still runs on the original HEIC buffer before upload.Test plan
pnpm test:run src/lib/telegram/chat/__tests__/uploadPhotoAttachment.test.tspnpm test:run src/lib/telegram/chat/__tests__/uploadPhotoAttachment.heic.test.tsMade with Cursor
Summary by CodeRabbit
New Features
Bug Fixes
Tests