[#455][FIX] 개인 회고가 책 상세의 회고 기록 목록에 안 보이던 문제 수정 - #456
Merged
Conversation
getRetrospectiveRecords가 path의 personalBookId(책장 항목 PK)를 실제 Book.id로 취급해 WHERE b.id = :bookId 쿼리에 그대로 전달, 실데이터에서 personalBookId != bookId라 회고 목록이 항상 비어 있었음. 타임라인 서비스와 동일하게 PersonalBook을 거쳐 실제 bookId를 해석하도록 수정하고, 소유자 검증(validatePersonalBook)도 함께 수행. 테스트는 personalBookId != bookId로 분리해 변환된 bookId로 조회하는지 검증(회귀 방지). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
PR 요약
이슈 번호
Closes #455
주요 변경 사항
PersonalRetrospectiveService.getRetrospectiveRecords: path의personalBookId(책장 항목 PK)를 실제Book.id로 그대로 사용하던 것을,validatePersonalBook으로PersonalBook을 조회해 실제bookId로 변환하도록 수정. 회고 조회 쿼리는WHERE b.id = :bookId(실제 도서 PK 기대)라 실데이터에서personalBookId != bookId이면 결과가 항상 비어 있었음. 타임라인 서비스(getTimeline)와 동일한 방식으로 정렬하고, 소유자 검증도 함께 수행.PersonalRetrospectiveServiceTest: 기존 테스트가 입력값을bookId라 부르며 동일 값으로 버그를 가리고 있던 것을,personalBookId(7L) != bookId(1L)로 분리해 "변환된 실제 bookId로 조회"하는지 검증하도록 갱신(회귀 방지). 없는 책 케이스는BOOK_NOT_IN_SHELF로 변경.참고 사항
GET /api/book/{personalBookId}/records/retrospectivesBOOK_NOT_FOUND→BOOK_NOT_IN_SHELF로 바뀜(타임라인 엔드포인트와 일관)../gradlew test --tests "com.dokdok.retrospective.service.PersonalRetrospectiveServiceTest"통과(BUILD SUCCESSFUL).WHERE b.id = :bookId쿼리를 쓰는findByBookAndUser의 다른 호출부도 실제 bookId를 넘기는지 후속 점검 권장(이번 PR 범위 밖).🤖 Generated with Claude Code