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 개요
사용자가 하나의 협업 방 안에서 여러 개의 독립적인 코드 편집 세션을 생성하고 참여할 수 있도록 실시간 협업 시스템을 확장합니다.
💻 주요 변경 사항
데이터베이스 모델링:
Room), 코드 세션(CodeSession), 참여자(RoomParticipant) 엔티티를 신규 생성하여 협업 정보를 영속적으로 관리하도록 개선했습니다.REST API 구현:
POST /api/collab-rooms: DB에 방과 기본 세션을 생성하는 API를 구현했습니다.POST /api/collab-rooms/{roomId}/sessions: 특정 방에 새로운 코드 세션을 추가하는 API를 구현했습니다.WebSocket 로직 개편:
/topic/room/{roomId}/session/{sessionId}형태로 세분화하여 세션 간 통신을 완벽히 분리했습니다.CodeCollabController가sessionId를 기반으로 메시지를 처리하도록 수정하고, 방장이 참여자의 쓰기 권한을 회수하는revoke-permission기능을 추가했습니다.인증 및 이벤트 처리 개선:
StompChannelInterceptor에서 WebSocket 세션에 Spring Security의Authentication객체를 직접 등록하여, 이후의 모든 STOMP 메시지가 안정적으로 인증되도록 수정했습니다.WebSocketEventListener에@Transactional을 적용하여LazyInitializationException을 해결하고, 첫 구독 시 DB 정보를 바탕으로 메모리에 실시간 방(WebSocketRoom)을 활성화하는 로직을 구현했습니다.프로젝트 구조 리팩토링:
collab이라는 새로운 기능 패키지로 분리하여 프로젝트 전체의 구조적 일관성과 가독성을 크게 향상시켰습니다.🔗 관련 이슈