Skip to content

Conversation

@jueunk617
Copy link
Collaborator

📌 개요

WebSocket의 보안, 성능, 구조를 개선하는 전반적인 리팩토링을 진행했습니다.

🔨 작업 내용

  • 인증된 Principal 사용 : 메시지 핸들러(WebSocketMessageController)에서 클라이언트가 전송한 userId 대신, 서버에서 인증된 Principal 객체를 사용하도록 변경하여 보안을 강화했습니다.

  • 온라인 유저 수 조회 성능 개선 : Redis KEYS 명령어를 사용하는 기존 로직을 제거하고, O(1) 복잡도의 카운터 방식으로 전체 온라인 유저 수를 조회하도록 최적화하여 서버 부하를 크게 줄였습니다.

  • 예외 처리 중앙화 : WebSocketMessageController 내 반복적인 try-catch 구문을 @MessageExceptionHandler로 통합하여 코드 중복을 제거하고 가독성 및 유지보수성을 향상시켰습니다.

🔗 관련 이슈

Closes #214

✅ 체크리스트

  • 기능 동작 확인
  • 테스트 코드 작성
  • 문서/주석 추가 및 최신화

@github-actions github-actions bot changed the title Refactor: websocket 도메인 리팩토링 Refactor: websocket 도메인 리팩토링 (#214) Oct 10, 2025
@joyewon0705 joyewon0705 self-requested a review October 10, 2025 02:26
@jueunk617 jueunk617 merged commit ee9cf87 into dev Oct 10, 2025
3 checks passed
@github-actions github-actions bot deleted the Refactor/214 branch October 10, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants