Repository navigation
fix: 같은 면접 기록을 다시 받아도 질문·답변과 PK를 바꾸지 않게 함(N-3) - #99
Merged
Merged
Conversation
POST /api/interviews/result는 받을 때마다 질문·답변을 지우고 다시 넣었다. 채팅 서버가 저장 성공 후 응답을 받지 못해 같은 기록을 다시 보내면(Chat N-2) 질문 PK가 바뀌고 채점·음성 분석 준비가 다시 돌았다. - 진행 중인 면접만 종료 상태로 바꾸는 조건부 갱신(claimResultSave)으로 처음 저장을 판정한다. 동시에 온 요청은 행 잠금에서 기다렸다가 0을 받는다. 앞 요청이 롤백되면 뒤 요청이 차지한다 - 이미 저장한 면접이면 질문·답변을 건드리지 않고 200을 돌려준다. 내용이 달라도 처음 것을 둔다 - 처음 저장일 때만 채점·음성 분석 준비(onTranscriptSaved)를 부른다 - 상태가 IN_PROGRESS로 와도 COMPLETED로 저장한다. 진행 중으로 두면 다시 온 기록을 처음 것으로 본다 면접을 종료 상태로 바꾸는 곳은 기록 저장뿐이고 질문·답변과 한 트랜잭션이라, 종료 상태 = 저장 완료다. 스키마 변경 없음. Chat N-2와 같은 날 배포한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danjee2009
reviewed
Oct 15, 2026
danjee2009
left a comment
Member
There was a problem hiding this comment.
검토 범위: 면접 기록의 최초 저장 판정, 질문·답변 트랜잭션과 재전송 처리를 확인했습니다. PR 본문에 적힌 테스트 통과는 확인했으며, GitHub 테스트 체크는 검토 시점에 진행 중이었습니다. 현재 코드에서 추가로 지적할 실질적 문제는 찾지 못했습니다.
Contributor
|
#99 — [P2] 재전송을 건너뛰면서 누락된 후속 작업도 복구하지 못합니다. |
재전송을 건너뛰면서 채점 준비(onTranscriptSaved)도 부르지 않아, 처음 저장이 커밋된 직후 서버가 내려가거나 준비 중 DB 오류가 나면 대기 행이 끝내 생기지 않았다. 스윕은 있는 대기 행만 훑어 복구하지 못한다(PR #99 리뷰). - 기록은 다시 저장하지 않되, 받을 때마다 onTranscriptSaved를 부른다. 종류마다 한 번만 요청하는 멱등 동작이라 있는 대기 행은 다시 요청하지 않고 빠진 행만 채운다(FeedbackDispatchServiceTest가 확인) - 쓰이지 않게 된 saveInterview의 boolean 반환을 걷어내 ChatInterviewResultService를 main과 같은 흐름으로 되돌린다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2-dayeon
approved these changes
Oct 15, 2026
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
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.
개요
A-1 N-3 "면접 결과 저장의 멱등성"입니다. main(bd6663e) 기준입니다. 스키마 변경은 없습니다.
POST /api/interviews/result가 요청을 받을 때마다 질문·답변을 지우고 다시 넣었습니다.변경
1. 처음 저장 판정 (
InterviewRepository.claimResultSave)update interview set status = :status where interview_id = :id and status = 'IN_PROGRESS'의 갱신 건수로 판정합니다.2. 저장 (
InterviewService.saveInterview)IN_PROGRESS로 와도COMPLETED로 저장합니다. 진행 중으로 두면 다시 온 기록을 처음 것으로 보고 또 저장합니다(기존 주석의 "기록을 넘겼다는 것 자체가 면접이 끝났다는 뜻"과 같은 판단).3. 후속 작업 (
ChatInterviewResultService.handleResult)onTranscriptSaved(채점·음성 분석 준비)는 지금처럼 부릅니다(리뷰 반영). 이 메서드는 종류마다 한 번만 요청하는 멱등 동작입니다. 있는 대기 행은 다시 요청하지 않고 빠진 행만 채웁니다(FeedbackDispatchServiceTest의 "채팅 서버가 기록을 다시 보내도 두 번 요청하지 않는다").ChatInterviewResultService는 main과 같습니다(주석만 추가).외부에서 보이는 동작 변화
배포 순서 (중요)
테스트
./gradlew test전체 640개가 통과했습니다.InterviewResultIdempotencyTest(신규,@SpringBootTest, 실제 DB)InterviewServiceSaveResultTest: 이미 저장한 면접이면 지우기·넣기·면접 저장을 하지 않는지,IN_PROGRESS로 와도COMPLETED로 차지하는지 확인합니다.claimResultSave → 1). 단언문은 바꾸지 않았습니다.참고
🤖 Generated with Claude Code