Skip to content

feat(chat): 채팅방 채팅 메세지 전달 로직 디버깅 (#78)#171

Merged
jaehyeok-code merged 6 commits intomainfrom
dev
Aug 26, 2025
Merged

feat(chat): 채팅방 채팅 메세지 전달 로직 디버깅 (#78)#171
jaehyeok-code merged 6 commits intomainfrom
dev

Conversation

@jaehyeok-code
Copy link
Contributor

@jaehyeok-code jaehyeok-code commented Aug 26, 2025

Summary by CodeRabbit

  • New Features
    • 채팅 전송 경로가 /chat/{roomId}/send 로 변경되었습니다.
    • 채팅/알림 메시지가 Redis를 통해 모든 서버 인스턴스에 실시간 전파됩니다.
    • 드래프트 실시간 구독 경로가 /topic/draft.{id} 로 통합되었습니다.
  • Documentation
    • OpenAPI에 WebSocket 관련 DTO 스키마가 추가되어 문서화가 확장되었습니다.
  • Chores
    • 드래프트 오픈/락 시간이 20:50/21:00(KST)로 조정되었습니다.
    • 선수 정보 업데이트 시 ‘코드’ 값은 더 이상 변경되지 않습니다.

@jaehyeok-code jaehyeok-code self-assigned this Aug 26, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

채팅/알림의 Redis 팬아웃 경로와 WebSocket 라우팅을 정비: 채팅 전송 엔드포인트를 /chat/{roomId}/send로 변경하고 Redis 퍼블리시 중심 흐름으로 통합. 퍼블리셔/서브스크라이버 동작 및 채널명 규칙 수정. WS 스키마를 OpenAPI에 등록. 드래프트 시간 상수 변경과 일부 포맷/사소한 정리 포함.

Changes

Cohort / File(s) Change summary
Chat Redis Pub/Sub Core
backendProject/.../chat/bus/ChatRedisPublisher.java, backendProject/.../chat/bus/ChatRedisSubscriber.java
퍼블리셔: 노드 ID를 인스턴스 UUID로 생성, publishToRoom(UUID, Map)로 시그니처 변경, 예외 전파 제거, 페이로드에 _src 주입, ChatChannels.roomChannel(roomId) 사용. 서브스크라이버: 자기발 원천 필터 제거, 수신 즉시 STOMP로 포워딩.
Chat Controller Routing
backendProject/.../chat/controller/ChatMessagingController.java
엔드포인트 /chat/{roomId}/send, @DestinationVariable UUID roomId 도입. 로컬 브로드캐스트 제거, Redis 단일 퍼블리시로 전환. 트랜잭션 및 JsonProcessingException 처리 제거.
Chat Notifications
backendProject/.../chat/controller/ChatNotificationController.java, backendProject/.../chat/service/Impl/ChatNotificationServiceImpl.java
주석 처리되었던 Redis 퍼블리시 호출 재활성화(팬아웃). 기존 STOMP 브로드캐스트는 유지.
Redis Topics & Subscriber
backendProject/.../global/configuration/RedisConfig.java, backendProject/.../global/redis/RedisSubscriber.java
RedisMessageListenerContainer에서 PatternTopic("chat/*") 구독 제거. 드래프트 구독 유지. RedisSubscriber 전송 목적지를 "/topic/draft.{id}"로 통일.
WebSocket Broker Config
backendProject/.../global/configuration/UnifiedWebSocketConfig.java, backendProject/.../global/configuration/MatchWebSocketConfig.java
브로커 하트비트용 TaskScheduler 및 하트비트 설정 제거. 주석 예시(와일드카드 오리진) 정리. 기능적 변경은 하트비트 비설정만 반영.
OpenAPI Configs
backendProject/.../global/configuration/OpenApiConfig.java, backendProject/.../global/configuration/OpenApiWsSchemasConfig.java
OpenApiConfig는 포매팅만. 신규 OpenApiWsSchemasConfig 추가로 WS DTO(AssignDto, DraftStartMessage, MatchStatusResponse, StatusMessage, UserIdMessage, RoundInfo) 스키마 등록 커스터마이저 제공.
Draft Timing
backendProject/.../domain/match/service/DraftTimingService.java
드래프트 창 시간 상수 변경: OPEN_TIME 08:00→20:50, LOCK_TIME 17:05→21:00. 계산 로직은 동일.
Entities & Domain Minor
backendProject/.../chat/entity/ChatReadState.java, backendProject/.../player/entity/Player.java
ChatReadState는 포매팅/가독성 변경(동일 로직). Player의 updatePlayer에서 this.code 갱신 제거(다른 필드 업데이트는 동일).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant Cmc as ChatMessagingController
  participant Pub as ChatRedisPublisher
  participant R as Redis
  participant Sub as ChatRedisSubscriber
  participant B as STOMP Broker
  participant U as Subscribed Clients

  C->>Cmc: /chat/{roomId}/send (payload)
  Cmc->>Pub: publishToRoom(roomId, payload{...})
  Pub->>Pub: payload["_src"]=nodeId
  Pub-->>R: PUBLISH ChatChannels.roomChannel(roomId), json(payload)
  R-->>Sub: onMessage(channel, body)
  Sub->>B: convertAndSend(ChatChannels.toTopic(channel), payload)
  B-->>U: /topic/chat/{roomId} 메시지 전달
  note over Sub,B: 자기발 필터링 없음 (변경됨)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • hwichoi0317
  • Kim-Jaehyun0328
  • wjkim9
  • roode1017

Poem

토끼는 귀를 세우고 큐를 듣네, pop!
방 번호 따라 휙— Redis로 hop!
브로커는 토픽에 척, 구독자는 덕!
밤 열 시 문 열고, 아홉 시엔 락—똑딱!
스키마도 등록 완료, 채팅길은 막힘없다 복복 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 74c0877 and be1395a.

📒 Files selected for processing (14)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/bus/ChatRedisPublisher.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/bus/ChatRedisSubscriber.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/controller/ChatMessagingController.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/controller/ChatNotificationController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/entity/ChatReadState.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/service/Impl/ChatNotificationServiceImpl.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/service/DraftTimingService.java (3 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/entity/Player.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/MatchWebSocketConfig.java (0 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/OpenApiConfig.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/OpenApiWsSchemasConfig.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/RedisConfig.java (0 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/UnifiedWebSocketConfig.java (0 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/redis/RedisSubscriber.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jaehyeok-code jaehyeok-code merged commit e11890b into main Aug 26, 2025
1 check was pending
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.

2 participants