Conversation
- direct room의 멤버 접근 검증과 나간 방 복원 판단을 전용 서비스로 분리해 ChatService의 조회/전송 흐름 부담을 낮춤 - visibleMessageFrom을 복원 전 기준으로 반환하는 기존 정책을 유지해 메시지 조회 가시 범위가 바뀌지 않도록 함 - 분리한 정책의 단위 테스트를 추가해 나간 방 복원과 접근 거부 조건을 고정
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (4)**/*.java📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{sql,java}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*⚙️ CodeRabbit configuration file
Files:
src/main/java/**/*.java⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (42)📓 Common learnings📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-25T06:58:54.393ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-13T00:26:23.225ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-25T06:58:54.393ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T09:44:01.804ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-25T06:58:54.393ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T09:44:01.804ZApplied to files:
📚 Learning: 2026-04-24T12:50:59.744ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
📚 Learning: 2026-04-22T08:07:59.395ZApplied to files:
🔇 Additional comments (3)
📝 WalkthroughWalkthrough새로운 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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 docstrings
🧪 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
|
- setUp에서만 쓰는 보조 서비스 인스턴스를 지역 변수로 좁혀 테스트 상태를 줄임 - 복원 테스트는 반환 객체보다 변경 대상 멤버 상태를 직접 검증해 의도를 명확히 함
There was a problem hiding this comment.
Pull request overview
ChatService에 남아 있던 direct room 접근 검증/복원(visibleMessageFrom 기준 포함) 책임을 ChatDirectRoomAccessService로 분리해, 메시지 조회/전송/뮤트 등에서 재사용하도록 리팩터링한 PR입니다. (Refs #594)
Changes:
- direct room 멤버 접근 가능 여부 확인 및 “나간 방 복원” 판단 로직을
ChatDirectRoomAccessService로 이동 ChatService에서 direct room 관련 접근 검증 호출부를 신규 서비스로 치환하고 기존 private helper 제거- direct room 접근/복원 정책에 대한 단위 테스트(
ChatDirectRoomAccessServiceTest) 추가 및 기존ChatServiceTest생성자 구성 갱신
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/java/gg/agit/konect/domain/chat/service/ChatService.java | direct room 접근/복원 로직을 신규 서비스로 위임하도록 경로 정리 및 기존 helper 제거 |
| src/main/java/gg/agit/konect/domain/chat/service/ChatDirectRoomAccessService.java | direct room 멤버 조회/접근 검증/복원 로직을 캡슐화한 전용 서비스 추가 |
| src/test/java/gg/agit/konect/unit/domain/chat/service/ChatServiceTest.java | ChatService 생성자 변경(신규 의존성 주입) 반영 |
| src/test/java/gg/agit/konect/unit/domain/chat/service/ChatDirectRoomAccessServiceTest.java | direct room 접근 및 “나간 방 복원/거부” 정책 단위 테스트 추가 |
- 메시지 조회는 lastReadAt 갱신과 direct room 복원을 수행하므로 readOnly 트랜잭션에서 제외 - direct room 접근 서비스가 나간 방 복원 상태를 변경할 수 있음을 트랜잭션 선언에 반영 - 조회 흐름에서 leftAt 해제가 영속화되지 않는 회귀를 방지
Agent-Logs-Url: https://github.com/BCSDLab/KONECT_BACK_END/sessions/91332fd5-a703-4c88-a058-cdb3b9ed4ea8 Co-authored-by: dh2906 <64298482+dh2906@users.noreply.github.com>
🔍 개요
ChatService에 남아 있던 direct room 멤버 접근 검증과 나간 방 복원 판단을ChatDirectRoomAccessService로 분리했습니다.🚀 주요 변경 내용
visibleMessageFrom기준 반환을 전용 서비스로 이동ChatService의 메시지 조회/전송/뮤트 접근 검증 경로가 새 서비스를 사용하도록 정리💬 참고 사항
./gradlew compileJava compileTestJavaCI=true ./gradlew test --tests 'gg.agit.konect.unit.domain.chat.service.ChatDirectRoomAccessServiceTest' --tests 'gg.agit.konect.unit.domain.chat.service.ChatServiceTest' --rerun-tasks./gradlew checkstyleMain --rerun-tasksCI=true ./gradlew test --tests 'gg.agit.konect.integration.domain.chat.ChatApiTest' --rerun-taskscheckstyleTest는 기존ClubMemberManagementServiceTest,NotificationInboxServiceTest,ChatApiTest의 120자 초과 위반으로 실패하며, 이번 변경 파일에는 별도 위반이 없습니다.✅ Checklist (완료 조건)