Conversation
- ChatService에 남아 있던 direct, club group, group 접근 검증 흐름을 ChatRoomAccessService로 이동 - direct SYSTEM_ADMIN 문의방 예외와 club group 멤버 보장 정책을 기존 경로 그대로 유지 - 뮤트, 방 이름 변경, 메시지 조회 접근 검증을 한 서비스로 모아 후속 멤버 명령 분리 범위를 줄임
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough채팅 방 접근 검증 로직을 전담하는 새로운 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🧪 JaCoCo Coverage Report (Changed Files)Summary
Coverage by File
|
There was a problem hiding this comment.
Pull request overview
ChatService에 남아 있던 채팅방 접근 검증 책임을 ChatRoomAccessService로 분리해, 메시지 조회/뮤트/방 이름 변경 등에서 접근 검증 호출 흐름을 일관되게 정리하는 리팩터링입니다. (#600)
Changes:
ChatRoomAccessService신규 추가: direct/club group/group 접근 가능 멤버 조회 및 뮤트 접근 예외 처리 제공ChatService에서 기존 접근 검증 로직을 제거하고 새 서비스 호출로 치환ChatServiceTest에서ChatService생성 시 새 의존성(ChatRoomAccessService) 주입 반영
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/test/java/gg/agit/konect/unit/domain/chat/service/ChatServiceTest.java | ChatRoomAccessService 생성/주입으로 테스트 셋업 업데이트 |
| src/main/java/gg/agit/konect/domain/chat/service/ChatService.java | 접근 검증 호출부를 ChatRoomAccessService로 위임하고 기존 private 메서드 제거 |
| src/main/java/gg/agit/konect/domain/chat/service/ChatRoomAccessService.java | 접근 검증 책임을 모은 신규 서비스 추가 |
- 뮤트 접근 검증에서 이미 조회한 User를 재사용해 불필요한 getById 호출을 피함 - 일반 room 접근 검증은 userId 기반으로 유지해 기존 테스트 스텁과 정책을 보존 - group 방 이름 변경 경로에서 불필요한 사용자 조회가 발생하지 않도록 접근 검증 분기를 정리
- 이미 받은 User 객체로 direct 방 접근 검증을 수행해 중복 사용자 조회를 피함 - club/group 접근 검증은 기존 userId 기반 정책과 예외 처리를 동일하게 유지 - 뮤트 접근 검증에서 사용자 조회 재사용 의도를 코드 경로에 직접 반영
- develop의 ChatInviteService, ChatRoomCreationService, ChatMessageSendService 분리 구조를 유지했습니다. - PR 브랜치의 ChatRoomAccessService 주입과 접근 검증 위임은 유지해 뮤트/방 이름/그룹 메시지 조회 권한 검증 흐름이 사라지지 않게 했습니다. - ChatServiceTest 생성자 설정도 두 변경 흐름을 함께 반영해 병합 후 단위 테스트가 같은 서비스 조합으로 실행되도록 정리했습니다.
- userId 기반 호출과 User 기반 호출이 같은 방 유형 분기를 공유하도록 정리 - direct 방에서만 User 재사용 여부가 달라지는 조건을 helper 안으로 모아 불필요한 중복 분기를 줄임 - 기존 접근 검증 정책과 direct 방 사용자 재조회 회피 동작은 그대로 유지
- 이미 조회한 ChatRoom을 가진 접근 검증 경로에서는 roomId 기반 재조회 대신 ChatRoom 기반 멤버 보장 경로를 사용합니다. - 기존 roomId 기반 API는 유지해 다른 호출부 호환성을 보존합니다. - 재조회 없이 멤버 보장이 이뤄지는 회귀 테스트를 추가해 같은 성능 회귀가 반복되지 않게 했습니다.
- develop의 메시지 읽음 및 채팅방 멤버 명령 서비스 분리 구조를 유지했습니다. - PR 브랜치의 ChatRoomAccessService 주입과 재조회 제거 흐름을 테스트 셋업에 함께 반영했습니다. - 충돌난 ChatServiceTest는 새 서비스 조합을 명시적으로 구성해 기존 접근 검증 회귀 테스트가 유지되도록 정리했습니다.
- nullable User 인자로 직접 채팅방 재조회 여부를 표현하던 흐름을 제거했습니다. - direct 방과 non-direct 방 분기를 public 진입점에서 명확히 나눠 읽기 쉽게 정리했습니다. - 기존 접근 검증 정책과 재조회 제거 동작은 유지했습니다.
🔍 개요
🚀 주요 변경 내용
💬 참고 사항
✅ Checklist (완료 조건)