docs: 프론트엔드에서 원자성 보장하기 (feat. 대용량 데이터 배치 업로드)#12
Conversation
정적 좌표 지옥에서 탈출한 동적 별자리 노드 시스템 구축기
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 풀 리퀘스트는 대용량 데이터 업로드 시 프론트엔드에서 원자성을 보장하는 전략을 다루는 새로운 블로그 게시물을 추가하는 것을 주요 내용으로 합니다. 특히 413 Payload Too Large 오류를 해결하기 위한 이미지 압축, API 청크 분할, 사용자 경험 기반의 부분 성공 복구 로직 구현 경험을 공유합니다. 이와 함께 Storybook MCP 관련 기존 블로그 게시물이 삭제되었으며, 게시물 목록 메타데이터가 업데이트되었습니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
이 PR은 대용량 데이터 배치 업로드 시 원자성을 보장하는 방법에 대한 새로운 기술 블로그 포스트를 추가하고, 관련하여 posts.json 데이터 파일을 업데이트합니다. 또한, 일부 오래된 포스트를 제거하고 package.json에 packageManager를 명시하여 개발 환경의 일관성을 높이는 변경 사항도 포함되어 있습니다. 전반적으로 블로그 콘텐츠를 관리하고 개선하는 좋은 업데이트로 보입니다. 몇 가지 사소한 오타 수정과 코드 개선 제안을 리뷰 코멘트로 남겼습니다.
|
|
||
| <br/> | ||
|
|
||
| ### 2️⃣ 요청청킹 + Batch 업로드 |
|
|
||
| > 중간에 일부 요청만 실패하면 어떻게 될까? | ||
|
|
||
| 예를들어, |
| 이런 상황이 발생하면, 서버에는 이미 10명의 원아 데이터만 등록된 상태가 됩니다. <br> | ||
| 이는 흔히 말하는 원자성(Atomicity)을 깨는 구조입니다. | ||
|
|
||
| #### 1. 실패시 전체 롤백 (All or Nothing) |
| const successIndices = results | ||
| .map((result, index) => (result.status === "fulfilled" ? index : null)) | ||
| .filter((index) => index !== null); |
There was a problem hiding this comment.
map과 filter를 연달아 사용하는 대신 flatMap을 사용하면 코드를 더 간결하게 작성할 수 있고, 중간 배열 생성을 피할 수 있어 더 효율적입니다.
| const successIndices = results | |
| .map((result, index) => (result.status === "fulfilled" ? index : null)) | |
| .filter((index) => index !== null); | |
| const successIndices = results.flatMap((result, index) => (result.status === "fulfilled" ? [index] : [])); |
| } | ||
| ``` | ||
|
|
||
| 이후, ReactHookForm 에서 이 에러를 잡아서 성공한 항목은 폼에서 제거하고, 실패한 항목만 그대로 남깁니다 |
No description provided.