Skip to content

[ICC-255] 구현 완료#117

Merged
GulSauce merged 1 commit intodevelopfrom
ICC-255-presigned
Jan 18, 2026
Merged

[ICC-255] 구현 완료#117
GulSauce merged 1 commit intodevelopfrom
ICC-255-presigned

Conversation

@GulSauce
Copy link
Member

@GulSauce GulSauce commented Jan 18, 2026

📢 설명

해당 Pull Request에 대해 간략하게 설명해주세요!

✅ 체크 리스트

  • 리뷰어가 체크할 내용을 작성해주세요!

Summary by CodeRabbit

  • Bug Fixes

    • Improved file upload error handling with user-friendly messages, including specific handling for conversion timeout errors.
    • Enhanced upload state management and timer cleanup on error scenarios.
  • Updates

    • Revised example text in quiz level descriptions to better reflect learning objectives.

✏️ Tip: You can customize this high-level summary in your review settings.

@GulSauce GulSauce merged commit d871fa7 into develop Jan 18, 2026
1 check was pending
@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The pull request extracts file upload logic into a new utility module that implements S3 presigned URL-based file uploads with polling verification for non-PDF files. The MakeQuiz component now imports this utility and updates its error handling to show user-friendly messages instead of rethrowing exceptions.

Changes

Cohort / File(s) Summary
New File Upload Utility
src/pages/MakeQuiz/util/fileUploader.js
Implements uploadFileToServer(file) function handling complete upload workflow: requests presigned URL from /s3/request-presign, uploads file to S3 via PUT with Content-Type and original filename headers, and polls /s3/check-file-exist for non-PDF files until file exists or 60-second timeout. Internal pollForFile() helper polls every 2 seconds and throws "변환 시간 초과" on timeout.
Component Refactoring & Error Handling
src/pages/MakeQuiz/index.jsx
Imports new uploadFileToServer utility, adjusts call site from destructured return to direct URL return, enhances error handling to compute user-facing messages and display CustomToast instead of rethrowing, ensures timer stops on error, and resets state in finally block. Updates example text in levelDescriptions.

Sequence Diagram

sequenceDiagram
    participant MakeQuiz as MakeQuiz Component
    participant Backend as Backend API
    participant S3 as AWS S3
    
    MakeQuiz->>Backend: POST /s3/request-presign<br/>(fileName, contentType, fileSize)
    Backend-->>MakeQuiz: {uploadUrl, finalUrl, isPdf}
    MakeQuiz->>S3: PUT uploadUrl<br/>(file, headers)
    S3-->>MakeQuiz: Upload successful
    
    alt isPdf == false
        rect rgba(100, 150, 200, 0.5)
        Note over MakeQuiz: Polling Loop (2s intervals, max 60s)
        loop Until "EXIST" or timeout
            MakeQuiz->>Backend: GET /s3/check-file-exist?url=finalUrl
            Backend-->>MakeQuiz: {status}
        end
        end
    end
    
    MakeQuiz-->>MakeQuiz: Return finalUrl
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A utility hopped into view,
With polling and presigned URLs too,
S3 uploads now cleanly delegated,
Error messages gracefully stated,
The code's refactored, fresh, and true!

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GulSauce GulSauce deleted the ICC-255-presigned branch January 21, 2026 15:21
@coderabbitai coderabbitai bot mentioned this pull request Jan 21, 2026
1 task
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.

1 participant