Repository navigation
[Feat] SSE complete 결과에 root_generation_id 추가 (#46) - #47
Merged
Merged
Conversation
프론트가 버전 목록·되돌리기 API를 쓰려면 root ID가 필요한데, 지금은 최초 생성 때 받은 song_id를 직접 보관해야 했다. 재생성 도중 새로고침해서 마지막 task_id만 남으면 root를 알 방법이 없었다. task_id로 SSE를 다시 구독하면 root까지 얻도록 complete 이벤트의 result에 root_generation_id를 추가한다. - CompletionResult 에 root_generation_id 추가 (최초 생성곡은 song_id와 같은 값, 재생성본은 원본의 ID, 백필 전 기존 곡은 null) - 이미 완료된 작업 구독 / 구독 중 AI 완료 콜백 수신, 두 경로 모두 반영 - Swagger의 SSE 설명 갱신. complete 이벤트는 성공(COMPLETED)만 전송하고 실패·취소는 progress 이벤트로 전달된다는 기존 설명 오류도 바로잡음 - SSE complete 이벤트를 검증하는 테스트 추가 (4개) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 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.
개요
SSE
complete이벤트의result에root_generation_id를 추가합니다. 프론트가 버전 목록·되돌리기 API(/songs/{root_generation_id}/versions)를 쓰려면 root ID가 필요한데, 지금은 최초 생성 때 받은song_id를 직접 보관해야 했습니다. 재생성 도중 새로고침해서 마지막task_id만 남으면 root를 알 방법이 없었고, 이제task_id로 SSE를 다시 구독하면 root까지 복구됩니다.Closes #46
변경 사항
CompletionResult에root_generation_id(Long) 추가song_id와 같은 값, 재생성본은 원본의 ID, root를 백필하기 전 기존 곡은nullcomplete, 구독 중 AI 완료 콜백을 받았을 때complete: 작업 완료 시 전송 (status: COMPLETED / FAILED)"이라고 적혀 있었지만, 실제로 실패·취소는progress이벤트(status: FAILED/CANCELED)로 전달되고complete는 성공(COMPLETED)일 때만 전송됨{ "status": "COMPLETED", "result": { "task_id": "task_xxx", "song_id": 42, "root_generation_id": 40, "audio_url": "https://...", "duration_seconds": 30.0 } }프론트 영향
complete의resultroot_generation_id필드 추가 (기존 필드는 그대로, 추가만이라 기존 코드는 영향 없음)versions·revert호출에 쓸 수 있음. 새로고침 후에는 보관해 둔task_id로 SSE를 다시 구독해도 같은 값을 얻음song_id는 root가 아님. 최초 생성곡만song_id == root_generation_idcomplete가 아니라progress이벤트로 옴 (이전부터 그랬고 문서만 틀렸음)범위 외
/me/songs항목, 생성·재생성 요청 응답에는 추가하지 않음 (닫은 [FEAT] 내 곡 목록을 곡(root) 단위 최종본 1건으로 변경 #41 범위)null로 내려감 (백필을 배포 직후 실행하는 전제, [Feat] 음악 버전 목록 조회·되돌리기 API 추가 (#26) #40 안내 참고)테스트
./gradlew build통과 (MockMvc + H2, 신규 4개 포함 76개)complete내용을 검증하는 테스트가 없어 이 PR에서 처음 추가 (TaskStreamCompletionTest)root == song_id), 재생성본(원본의 root 승계,song_id와 다름)null로 바꾸면 4개 모두 실패하는 것 확인EventSource로 받아 보는 것은 확인하지 못했습니다 (MockMvc가 기록한 SSE 본문으로 검증)🤖 Generated with Claude Code