Conversation
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 개요
마지막 참여자가 세션을 떠날 때 해당 세션을 자동으로 비활성화하는 기능을 구현하고, 참여자 상태 변경 시 최신 목록을 안정적으로 동기화하도록 방송 로직을 리팩토링합니다.
💻 주요 변경 사항
세션 자동 비활성화 기능 구현:
WebSocketRoomService에 세션별 실시간 참여자 목록을 추적하는 로직(sessionParticipantsMap 및 관련 메소드)을 추가했습니다.WebSocketEventListener의handleWebSocketDisconnectListener에, 나가는 사용자가 세션의 마지막 참여자인 경우 해당CodeSession의 상태를INACTIVE로 업데이트하는 로직을 구현했습니다.상태 브로드캐스팅 로직 중앙화 (리팩토링):
WebSocketEventListener에 있던broadcastRoomState헬퍼 메소드를RoomService로 이동시키고public으로 변경하여, 프로젝트 전역에서 호출할 수 있는 중앙 방송 기능으로 만들었습니다.RoomService의joinRoom,kickParticipant메소드와WebSocketEventListener의handleWebSocketSubscribeListener,handleWebSocketDisconnectListener가 모두 이 중앙화된broadcastRoomState메소드를 호출합니다.🔗 관련 이슈