[fix] 오픈채팅방 접속 문제 - #268
Conversation
Walkthrough그룹 매칭 요청 수락 시 사용 가능한 채팅방을 자동으로 배정하는 기능을 Changes그룹 매칭 승인 시 채팅방 할당 기능
Sequence DiagramsequenceDiagram
participant Controller
participant GroupRequestService
participant ChattingV2Service
participant GroupRepository
Controller->>GroupRequestService: permitRequest(leaderId, groupId)
GroupRequestService->>GroupRequestService: getValidatedGroup(groupId)
alt isGroup = true
GroupRequestService->>GroupRequestService: processGroupMatch(group)
Note over GroupRequestService: 그룹이 full인 경우
GroupRequestService->>GroupRequestService: group.setStatus(COMPLETED)
GroupRequestService->>GroupRequestService: assignChattingIfAbsent(group)
else
GroupRequestService->>GroupRequestService: processDirectMatch(group)
GroupRequestService->>GroupRequestService: assignChattingIfAbsent(group)
end
GroupRequestService->>GroupRequestService: group.chatting이 null?
alt chatting == null
GroupRequestService->>ChattingV2Service: assignChatting()
ChattingV2Service-->>GroupRequestService: chattingId
GroupRequestService->>GroupRepository: assignChattingToGroup(group, chattingId)
else
Note over GroupRequestService: 기존 채팅 유지
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/at/mateball/domain/groupRequest/GroupRequestServiceTest.java (1)
31-32: 💤 Low value테스트 strictness를 STRICT_STUBS로 변경 검토
현재
Strictness.LENIENT를 사용하고 있어 불필요한 스텁이 숨겨질 수 있습니다. 의존성이 많아 실용적인 선택일 수 있으나, 가능하다면Strictness.STRICT_STUBS로 변경하여 테스트 품질을 높이는 것을 권장합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/at/mateball/domain/groupRequest/GroupRequestServiceTest.java` around lines 31 - 32, Change the Mockito strictness in the GroupRequestServiceTest class from LENIENT to STRICT_STUBS: replace the annotation line `@MockitoSettings`(strictness = Strictness.LENIENT) with `@MockitoSettings`(strictness = Strictness.STRICT_STUBS) (keeping `@ExtendWith`(MockitoExtension.class) unchanged) so tests use Strictness.STRICT_STUBS and catch unnecessary or unused stubs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/test/java/at/mateball/domain/groupRequest/GroupRequestServiceTest.java`:
- Around line 31-32: Change the Mockito strictness in the
GroupRequestServiceTest class from LENIENT to STRICT_STUBS: replace the
annotation line `@MockitoSettings`(strictness = Strictness.LENIENT) with
`@MockitoSettings`(strictness = Strictness.STRICT_STUBS) (keeping
`@ExtendWith`(MockitoExtension.class) unchanged) so tests use
Strictness.STRICT_STUBS and catch unnecessary or unused stubs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 168ec5ce-a3ff-4e1d-88f8-f6f08ac4b570
📒 Files selected for processing (2)
src/main/java/at/mateball/domain/groupRequest/GroupRequestService.javasrc/test/java/at/mateball/domain/groupRequest/GroupRequestServiceTest.java
|
[memo] |
📌 이슈 번호
closed #267
✅ 어떻게 이슈를 해결했나요?
V3 매칭 요청 수락 흐름에서 매칭이 성사되었음에도 오픈채팅방이 배정되지 않아, 일부 활성 매칭에서
채팅방 입장하기클릭 시존재하지 않는 채팅방입니다메시지가 노출될 수 있는 문제를 수정했습니다.이번 작업에서는 V3 요청 수락 처리 흐름인
GroupRequestService에 채팅방 배정 로직을 추가했습니다.주요 수정 내용은 다음과 같습니다.
COMPLETED상태가 되는 시점에 오픈채팅방 배정 처리 추가ChattingV2Service.assignChatting()과GroupRepository.assignChattingToGroup()재사용findGroupWithLock(PESSIMISTIC_WRITE)기준으로 변경채팅방 중복 배정 방지는 아래 기준으로 처리했습니다.
group.getChatting()이 존재하면 새 채팅방을 배정하지 않음ALREADY_COMPLETED_GROUP으로 차단assignChatting()의PESSIMISTIC_WRITE락 기반 조회를 사용assignChattingToGroup의WHERE chatting_id IS NULL조건과 기존 유니크 제약으로 중복 연결 방지사용 가능한 채팅방이 없는 경우에는 기존 예외인
BusinessException(BusinessErrorCode.CHATTING_NOT_FOUND)를 그대로 사용합니다. 이 경우 수락 트랜잭션은 롤백되며, 별도 응답 구조 변경은 없습니다.변경 파일은 다음과 같습니다.
src/main/java/at/mateball/domain/groupRequest/GroupRequestService.javasrc/test/java/at/mateball/domain/groupRequest/GroupRequestServiceTest.java테스트는 아래 단위 테스트 기준으로 확인했습니다.
CHATTING_NOT_FOUND전파테스트 결과:
❤️ To 다진 / To 헤음
match_group.chatting_id가 정상적으로 채워지는지..채팅방 입장하기에서 유효한 카카오 오픈채팅 URL이 반환되는지....COMPLETED상태인데chatting_id가 없는 매칭은 이번 코드 변경만으로 자동 복구 안되가지고 이거 해결해보겠삼Summary by CodeRabbit
릴리스 노트
새로운 기능
개선 사항
테스트