Skip to content

Conversation

@LimKangHyun
Copy link
Collaborator

@LimKangHyun LimKangHyun commented Aug 4, 2025

🛰️ Issue Number

#180

🪐 작업 내용

  • 퇴장에 해당하는 cleanRoom, 입장에 해당하는 initializeRoomSocket 메서드에 SSE 이벤트 퍼블리셔를 추가했습니다.
  • 퀴즈가 문제의 정보까지 fetch join하는 getQuizWithQuestionsById 쿼리에서 findQuizById 쿼리로 문제 테이블은 Lazy 로딩하도록 변경 및 퀴즈의 문제 개수만 세는 getQuestionsCount를 추가하여 쿼리 두 개로 변경

📚 Reference

✅ Check List

  • 코드가 정상적으로 컴파일되나요?
  • 테스트 코드를 통과했나요?
  • merge할 브랜치의 위치를 확인했나요?
  • Label을 지정했나요?

@LimKangHyun LimKangHyun self-assigned this Aug 4, 2025
@LimKangHyun LimKangHyun added the enhancement New feature or request label Aug 4, 2025
@LimKangHyun LimKangHyun changed the title ✨ feat: SSE 인원 입퇴장 이벤트 추가 [feat] SSE 인원 입퇴장 이벤트 추가 Aug 4, 2025
Copy link
Collaborator

@jiwon1217 jiwon1217 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
Collaborator

@sehee123 sehee123 left a comment

Choose a reason for hiding this comment

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

👍 x 100

room.removePlayer(player);

Long quizId = room.getQuizId();
Quiz quiz = quizService.getQuizWithQuestionsById(quizId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

[L5-참고의견]
RoomUpdatedEvent를 통해 SSE 이벤트를 발급할 때 Question의 사용은 quiz.getQuestions().size()으로 문제의 크기만 사용하는 것으로 보입니다.
하지만, getQuizWithQuestionsById는 해당 퀴즈의 모든 문제들을 Fetch Join 해오기 때문에 불필요한 오버헤드의 발생이 존재하는 것 같습니다.
추후 가능하다면 RoomUpdatedEvent 리팩토링을 통해 qustion size를 따로 받아오는 방향으로 개선해 보는 것도 좋다는 생각이 들었습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

필요한 데이터만 가져오도록 쿼리를 findByQuizId와 getQuestionsCount쿼리로 분리해 변경하였습니다!

Copy link
Collaborator

@silver-eunjoo silver-eunjoo left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 !!

@LimKangHyun LimKangHyun changed the title [feat] SSE 인원 입퇴장 이벤트 추가 [refactor] SSE 인원 입퇴장 이벤트 추가 Aug 6, 2025
@LimKangHyun LimKangHyun changed the title [refactor] SSE 인원 입퇴장 이벤트 추가 [refactor] SSE 인원 입퇴장 이벤트 추가 및 SSE 사용 쿼리 분리 Aug 6, 2025
LimKangHyun and others added 2 commits August 8, 2025 12:47
- 퀴즈가 문제의 정보까지 fetch join하는 쿼리에서 findQuizById 쿼리로 문제는 Lazy 로딩하도록 변경
@LimKangHyun LimKangHyun merged commit 6a34772 into dev Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 입퇴장시 SSE 업데이트 추가 및 SSE 사용 쿼리 분리

6 participants