-
Notifications
You must be signed in to change notification settings - Fork 3
청크파일 업로드 방식 로직 수정 #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
청크파일 업로드 방식 로직 수정 #271
Conversation
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
❌ Deploy Preview for jootalkpia failed.
|
handje
reviewed
Feb 23, 2025
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불필요한 코드는 주석 처리가 아닌 삭제해주시면 코드를 읽기에 더 좋을 것 같습니다 :)
아래 내용은 fix로 새로운 이슈로 고치는 것도 좋을 것 같습니다
- 영상을 처리하는 것으로 보이는데, 영상 preview및 전송이 동작하지 않습니다 (테스트 영상 기준, avi확장자)
- 이미지를 첨부한 뒤, 삭제하고 text만 보내도 이전에 삭제한 이미지가 함께 채팅에 보내지고 있습니다.
- 개발이 끝난 후, 이 로직에 관해 문서로 정리해서 공유해주시면 좋은 기록이 될 것 같아요 !
handje
approved these changes
Feb 23, 2025
…e-feat/file-chunk-load
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.
Pull request
Related issue
Motivation and context
Solution
동적 네트워크 조건에 따른 업로드 최적화
getDynamicChunkSize함수에서 네트워크 지연 시간(핑 테스트)을 측정하여, 지연 시간이 길면 더 작은 청크(2.5MB 또는 5MB)를, 빠른 네트워크에서는 기본 청크 사이즈(10MB)를 사용하도록 결정하도록 구현하였습니다.getUploadConcurrency함수는 네트워크 상태에 따라 동시에 전송할 청크 개수를 5, 3, 혹은 1개로 설정하여 업로드 효율성을 높였습니다.청크 기반 파일 업로드 개선
createChunks함수를 통해 파일을 동적으로 결정된 청크 사이즈로 분할하였습니다.uploadChunkWithRetry함수에서는 업로드 실패 시 최대 5회까지 지수 백오프 방식으로 재시도하여 안정적인 업로드를 보장하였습니다.uploadChunksQueue함수는 네트워크 상태에 따른 동시성(worker)을 사용해 분할된 청크를 병렬로 업로드합니다.파일 검증 및 식별 기능 강화
validateFileType,validateFileSize,validateTotalFileSize함수를 통해 지원하는 파일 형식(이미지, 비디오)과 최대 파일 크기(이미지: 20MB, 비디오: 200MB, 전체: 1000MB)를 체크합니다.generateTempFileIdentifier함수로 사용자 ID, 타임스탬프, 파일 인덱스를 기반으로 임시 식별자를 생성합니다.React 기반 파일 관리 훅 개선
requestAnimationFrame을 사용하여 브라우저 렌더링 타이밍에 맞춰 캔버스 작업을 실행, UI 스레드의 부하를 줄이고 안정성을 높입니다.How has this been tested
Types of changes
Checklist