[STORY-201] 메일 스레드 데이터 누락 가능 무결성 문제 수정 - #168
Conversation
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough메일 응답의 nullable 문자열을 빈 문자열로 정규화하고, Gmail 응답의 누락된 Changes메일 데이터 무결성
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🔗 관련 작업
👤 User Story
📌 Task
💡 작업 내용
internalDate가 누락된 경우 유효하지 않은 외부 응답으로 처리해 저장을 차단했습니다.📝 추가 설명
1. 문제 원인 및 수정
saveMissingMessagesFromThreadSnapshot()경로에서 Message는 정상 저장됐지만 Thread의 최신 제목, snippet, 참여자, 메시지 시각은 갱신되지 않았습니다.null에replace()또는trim()을 호출하는 런타임 오류가 발생했습니다.ThreadAggregate에 신규 또는 기존 활성 Message를 병합하고 최신 요약 정보를 Thread에 반영하도록 수정했습니다.flowchart LR A[Gmail 상태 변경 이벤트] --> B[Thread 스냅샷 조회] B --> C[누락 Message 저장] C --> D[ThreadAggregate 병합] D --> E[Thread 최신 요약 갱신] E --> F[nonnull 목록 응답]2. 응답 및 외부 연동 방어
ThreadSummaryResponse의latestSubject,snippet과MailAddressResponse.email은null이면 빈 문자열로 변환합니다.internalDate가 없으면 core는MailSendException, worker는MailPushException을 발생시켜 불완전 메시지 저장을 방지합니다.lastMessageAt에는 임의 시각을 사용하지 않고 Gmail 메시지 시각의 유효성을 보장합니다.3. 배포 DB 정리 및 검증
last_message_at IS NULL인 Thread 9건을 대상으로 확정했습니다.mail.sync.gmail.initial.thread-batch큐로 재동기화했습니다.last_message_at이 유효함을 확인했습니다.last_message_at IS NULL잔여 건수는 0건이며, 동기화 DLQ도 증가하지 않았습니다.⚡️ Test 결과
cd core && ./gradlew :testcd worker && ./gradlew :testgit diff --check