Repository navigation
[SBISSUE-22274] fix: Map mov to video/quicktime so iOS camera videos keep their extension - #327
Draft
OnestarLee wants to merge 1 commit into
Draft
OnestarLee wants to merge 1 commit into
OnestarLee wants to merge 1 commit into
Conversation
…sion
EXTENSION_MIME_MAP had the QuickTime row reversed ('video/quicktime': 'mov'),
so getFileExtensionFromMime('video/quicktime') and getMimeFromFileExtension('mov')
both returned an empty string. A video recorded with the iOS camera through
expo-image-picker has no fileName and the MIME type video/quicktime, so
normalizeFile named it with a timestamp and never found an extension. The video
was uploaded without one, and saving it to the photo library failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #327 +/- ##
=======================================
Coverage 12.31% 12.31%
=======================================
Files 361 361
Lines 9108 9108
Branches 2565 2565
=======================================
Hits 1122 1122
Misses 7910 7910
Partials 76 76 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For Internal Contributors
SBISSUE-22274
Description Of Changes
EXTENSION_MIME_MAP의 QuickTime 항목만 키와 값이 뒤바뀌어 있었습니다('video/quicktime': 'mov'). 그래서getFileExtensionFromMime('video/quicktime')와getMimeFromFileExtension('mov')가 둘 다 빈 문자열을 반환했습니다. 다른 항목과 같은 방향인'mov': 'video/quicktime'으로 바로잡았습니다.fileName없이mimeType: 'video/quicktime'만 넘어옵니다.normalizeFile은 이름을Date.now()로 정한 뒤 확장자를 MIME → URI content-type 순으로 찾는데, 두 단계 모두 위 함수를 거쳐서 실패합니다. 결과적으로 영상이 확장자 없는 이름(예:1794111174788)으로 업로드됩니다.Could not get the file's extension - it was empty.로 거부하고, UIKit은 "Couldn't download file." 토스트를 띄웁니다.IMG_xxxx.MOV)은 이름에 확장자가 있어서 영향이 없고, Android 카메라는 MP4라서 영향이 없습니다.5e44d4f7(v2.4.1, utils 구조 리팩터링)부터 있던 버그입니다. 이미 확장자 없이 전송된 메시지는 그대로 남고, 새로 보내는 영상부터 적용됩니다.테스트
getFileExtensionFromMime('video/quicktime')→.mov,getMimeFromFileExtension('mov')→video/quicktimenormalizeFile: 이름 없는video/quicktime→{timestamp}.mov,IMG_0001.MOV+ 타입 없음 →video/quicktimeyarn test전체 통과(207 passed)검증 (Expo 54 샘플, expo-image-picker 17.0.8, iPhone 17 Pro iOS 26.1 시뮬레이터)
수정 전은 배포된
@sendbird/uikit-react-native@3.12.0을 그대로 썼고, 수정 후는 같은 패키지에 이 PR의 한 줄만 적용했습니다.name/typelaunchCameraAsync만 임시로 바꿔 iOS 카메라 녹화와 같은 형태(fileName: null,mimeType: 'video/quicktime',Caches/ImagePicker/*.mov의 실제 .mov 파일)를 돌려주게 했습니다. 이후 경로(normalizeFile→ 전송 → FileViewer 저장)는 실제 UIKit 코드입니다. 이 harness는 커밋하지 않았습니다.name/type을 표시하도록 string set을 임시로 바꿨습니다. 수정 전에는 서버에 남은type도video였고, 수정 후에는video/quicktime입니다.pr-assets/SBISSUE-22274브랜치에 올렸습니다. 머지 후 삭제해도 됩니다.Types Of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that apply_🤖 Generated with Claude Code