Skip to content

[SBISSUE-22274] fix: Map mov to video/quicktime so iOS camera videos keep their extension - #327

Draft
OnestarLee wants to merge 1 commit into
mainfrom
fix/SBISSUE-22274
Draft

OnestarLee wants to merge 1 commit into
mainfrom
fix/SBISSUE-22274

Conversation

@OnestarLee

@OnestarLee OnestarLee commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

For Internal Contributors

SBISSUE-22274

Description Of Changes

  • EXTENSION_MIME_MAP의 QuickTime 항목만 키와 값이 뒤바뀌어 있었습니다('video/quicktime': 'mov'). 그래서 getFileExtensionFromMime('video/quicktime')와 getMimeFromFileExtension('mov')가 둘 다 빈 문자열을 반환했습니다. 다른 항목과 같은 방향인 'mov': 'video/quicktime'으로 바로잡았습니다.
  • 영향 경로: expo-image-picker로 iOS 카메라에서 녹화하면 fileName 없이 mimeType: 'video/quicktime'만 넘어옵니다. normalizeFile은 이름을 Date.now()로 정한 뒤 확장자를 MIME → URI content-type 순으로 찾는데, 두 단계 모두 위 함수를 거쳐서 실패합니다. 결과적으로 영상이 확장자 없는 이름(예: 1794111174788)으로 업로드됩니다.
    • 받는 쪽은 확장자 없는 파일을 내려받아 바로 재생하지 못합니다(커뮤니티 리포트: JS UIKit).
    • 보내는 쪽 Expo 앱에서도 저장이 실패합니다. expo-media-library가 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/quicktime
  • normalizeFile: 이름 없는 video/quicktime → {timestamp}.mov, IMG_0001.MOV + 타입 없음 → video/quicktime
  • 수정 전 새 테스트 4개 실패, 수정 후 yarn 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 / type
FileViewer 저장
  • 시뮬레이터에는 카메라가 없어서, 샘플 앱에서 launchCameraAsync만 임시로 바꿔 iOS 카메라 녹화와 같은 형태(fileName: null, mimeType: 'video/quicktime', Caches/ImagePicker/*.mov의 실제 .mov 파일)를 돌려주게 했습니다. 이후 경로(normalizeFile → 전송 → FileViewer 저장)는 실제 UIKit 코드입니다. 이 harness는 커밋하지 않았습니다.
  • 업로드된 메시지 확인용으로 FileViewer 헤더에 name / type을 표시하도록 string set을 임시로 바꿨습니다. 수정 전에는 서버에 남은 type도 video였고, 수정 후에는 video/quicktime입니다.
  • RN CLI(react-native-image-picker) 경로는 실기기로 확인하지 않았습니다.
  • 스크린샷은 pr-assets/SBISSUE-22274 브랜치에 올렸습니다. 머지 후 삭제해도 됩니다.

Types Of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply_

  • Bugfix
  • New feature
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance (ex) Prettier)
  • Build configuration
  • Improvement (refactor code)
  • Test

🤖 Generated with Claude Code

…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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 12.31%. Comparing base (4b293d9) to head (3e5cf8a).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants