Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/issue#166: 모임 목록 조회 시 404 예외 발생 문제 해결 #170

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

us4c0d3
Copy link
Contributor

@us4c0d3 us4c0d3 commented Nov 11, 2024

PR

🔍 원인

  • 모임 단일 조회(JPA 기능 이용)시 정상적으로 데이터를 반환
  • 그러나 모임 목록 조회(JPQL 이용)시 Team.getOwnerKakaoId()로직에서 오류 발생
  • Team에 연결된 엔티티인 teamMemberList를 정상적으로 로드하지 못한다고 판단하여 이를 위주로 해결

✨ 작업 내용

  • JPQL 일부 수정
  • 검증을 위해 TeamRepositoryTest 추가

🔍 참고사항

  • Team.getOwnerKakaoId() 메서드의 경우 도메인 테스트로 분류해야 됨이 맞으나, 데이터를 직접적으로 호출 및 확인이 필요해 repository test에 작성

⚠️ 의논 필요

  • 팀원들의 의견을 듣고 싶거나, 의논이 필요한 사항이 있다면 작성

🐞현재 버그

  • 현재 버전에 버그가 있다면 작성

#️⃣ 연관 이슈(Git Close)

close #166


😊 리뷰 규칙을 지킵시다

코드 리뷰는 Pn룰에 따라 작성하기.
Reviewer가 피드백을 남길 때 Assignee에게 얼마나 해당 피드백에 대해 강조하고 싶은 지 표현하기 위한 규칙입니다.

  • P1 : 꼭 반영해 주세요 (Request Changes) - 이슈가 발생하거나 취약점이 발견되는 케이스 등
  • P2 : 반영을 적극적으로 고려해 주시면 좋을 것 같아요 (Comment)
  • P3 : 이런 방법도 있을 것 같아요~ 등의 사소한 의견입니다 (Chore)

@us4c0d3 us4c0d3 added 🐞 Bug 버그 발견 ✅ Test test 관련 labels Nov 11, 2024
@us4c0d3 us4c0d3 self-assigned this Nov 11, 2024
Copy link

github-actions bot commented Nov 11, 2024

Test Results

79 tests   79 ✅  8s ⏱️
20 suites   0 💤
20 files     0 ❌

Results for commit dde4442.

♻️ This comment has been updated with latest results.

@us4c0d3 us4c0d3 linked an issue Nov 11, 2024 that may be closed by this pull request
1 task
Copy link
Contributor

@Lucerna00 Lucerna00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제 로컬에선 JPQL의 param과 관련된 에러가 발생했고, 이를 해결하니 정상적으로 여러 모임이 조회됐습니다. 이 부분도 고려해 주시면 좋을 것 같습니다!

Comment on lines 51 to 54
@DisplayName("모임의 isClosed `true`상태인 데이터를 불러온다")
void testFindByIsClosed_withOpenTeam() {
// given
Boolean isClosed = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: 모임 isClosed가 false인 상태일 때의 테스트 같습니다

@Query("SELECT t FROM Team t " +
"JOIN FETCH t.teamMemberList tm " +
"JOIN FETCH tm.member " +
"JOIN t.teamMemberList tm " +
"WHERE tm.member.id = :memberId " +
"AND t.isClosed = :isClosed")
List<Team> findByIsClosed(@Param("memberId") Long memberId, Boolean isClosed);
Copy link
Contributor

@Lucerna00 Lucerna00 Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: 이전 PR 머지 후 제 로컬 환경에선 Either use @Param on all parameters except Pageable and Sort typed once, or none at all 에러가 발생했습니다. isClosed에도 @Param("isClosed")가 필요할 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. JPQL 쓰는 것들은 가능하면 Param은 무조건 사용하는게 좋겠네요

@us4c0d3 us4c0d3 requested a review from Lucerna00 November 11, 2024 17:48
Copy link
Contributor

@dkswoals dkswoals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~!!

Copy link
Contributor

@Lucerna00 Lucerna00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug 버그 발견 ✅ Test test 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FIX: Team.getOwnerKakaoId 호출 문제 수정
3 participants