Skip to content

Conversation

@jjaeroong
Copy link
Collaborator

@jjaeroong jjaeroong commented Aug 13, 2025

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 삭제
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트
  • 리팩터링

반영 브랜치

ex) feat/login -> dev

작업 내용

ex) 로그인 시, 구글 소셜 로그인 기능을 추가했습니다.

테스트 결과

ex) 베이스 브랜치에 포함되기 위한 코드는 모두 정상적으로 동작해야 합니다. 결과물에 대한 스크린샷, GIF, 혹은 라이브

Summary by CodeRabbit

  • New Features
    • 계정 삭제 시 모집글/신청/저장/채팅 등 연관 데이터 일괄 정리 및 진행 상태별 안전한 처리 추가. 소유권 이전이 필요한 경우 충돌 오류와 안내 메시지 제공.
    • 채팅 메시지 삭제 기능과 실시간 삭제 알림 전송 지원.
  • Bug Fixes
    • 삭제되었거나 미확인 사용자에 대해 닉네임/역할 표기 로직 개선(불필요한 역할 접미사 제거, “(알 수 없음)” 유지).
    • 작성자 표기 일관성 향상으로 일부 화면의 잘못된 닉네임 노출 문제 수정.

@coderabbitai
Copy link

coderabbitai bot commented Aug 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

여러 저장소/컨버터/엔티티에 삭제·닉네임 표기 로직을 추가·정비하고, 사용자 탈퇴(UserCommandServiceImpl) 흐름을 대폭 개편했습니다. 포트/채팅/저장 기록의 일괄 조회·삭제 메서드가 추가되었고, 에러 코드가 보강되었습니다. 채팅 삭제 신호 발송 메서드와 DTO 변환 시 이름/역할 처리 조건이 변경되었습니다.

Changes

Cohort / File(s) Summary of changes
Chat delete/broadcast + converters
src/main/java/stackpot/mongo/ChatRepository.java, .../chat/repository/ChatRoomInfoRepository.java, .../chat/repository/ChatRoomRepository.java, .../chat/service/chat/ChatCommandService.java, .../chat/service/chat/ChatSendService.java, .../chat/converter/ChatConverter.java
채팅 삭제/정리용 리포지토리 메서드 추가, 채팅방 ID 일괄 조회 추가, 서비스에 메시지 삭제 및 삭제 알림 전송 메서드 추가, 사용자명+역할 문자열 생성 로직 조건화, 잘못된 Param import 교정 및 트랜잭션/수정 쿼리 추가
Pot batch delete/read helpers
.../pot/repository/PotRepository.java, .../pot/repository/PotApplicationRepository.java, .../pot/repository/PotMemberRepository.java, .../pot/repository/PotRecruitmentDetailsRepository.java, .../pot/repository/PotSaveRepository.java
사용자/상태 기반 Pot ID 조회 추가, 일괄 삭제용 쿼리 메서드 다수 추가, 기존 광범위 삭제 메서드 대체, 사용자별 PotSave 조회/삭제 및 사용자+포트 목록 기반 삭제 추가
Converters (display name handling)
.../feed/converter/FeedConverter.java, .../pot/converter/PotApplicationConverter.java, .../pot/converter/PotCommentConverter.java, .../pot/converter/PotMemberConverter.java
닉네임 표시를 RoleNameMapper 기반으로 통일, 삭제/미상 사용자 처리, 특정 경우 "(알 수 없음)" 유지, 일부 포맷/공백 조정
Entities & utils
.../pot/entity/Pot.java, .../user/entity/User.java, .../common/util/RoleNameMapper.java
Pot.recruitmentDetails에 cascade ALL + orphanRemoval 추가, User.deleteUser에 seriesList 안전 초기화, RoleNameMapper에 getWriterNickname(User) 추가
User deletion flow
.../user/service/UserCommandServiceImpl.java
탈퇴 시 제작자/일반 사용자 분기, 상태별 포트 정리(배치 삭제), 소유 이전 요구 에러 처리, 채팅/저장/신청/멤버십 정리, 관련 메서드 public/트랜잭션화 및 List 대상 일괄 삭제 지원
API status
.../apiPayload/code/status/ErrorStatus.java
POT_OWNERSHIP_TRANSFER_REQUIRED(CONFLICT, POT4005) 상수 추가

Sequence Diagram(s)

sequenceDiagram
  actor U as User
  participant UC as UserCommandServiceImpl
  participant PR as PotRepository
  participant PM as PotMemberRepository
  participant PA as PotApplicationRepository
  participant PRD as PotRecruitmentDetailsRepository
  participant PS as PotSaveRepository
  participant CR as ChatRoomRepository
  participant CC as ChatCommandService

  U->>UC: deleteUser()
  UC->>PR: findIdsByUserIdAndStatus(userId, COMPLETED/RECRUITING)
  UC->>PR: findIdsByUserIdAndStatusNotIn(userId, [COMPLETED, RECRUITING])
  alt has OTHER status pots
    UC-->>U: throw POT_OWNERSHIP_TRANSFER_REQUIRED
  else proceed
    UC->>PRD: deleteByPotIds(recruitingIds)
    UC->>PA: deleteByPotIds(recruitingIds)
    UC->>PR: deleteByUserIdAndPotIds(userId, recruitingIds)
    UC->>PM: deleteByUserIdAndPotIdIn(userId, ongoingIds)
    UC->>CR: findIdsByPotIdIn(ongoingIds)
    UC->>CC: deleteChatMessage(userId, chatRoomId)* (loop)
    UC->>PS: deleteByUser(user)
    UC-->>U: soft delete user
  end
Loading
sequenceDiagram
  participant S as ChatService
  participant SS as ChatSendService
  participant MB as MessageBroker
  participant C as Clients

  S->>SS: deleteMessage(chatRoomId, chatId)
  SS->>MB: convertAndSend("/sub/chat/"+chatRoomId, "DELETE_"+chatId)
  MB-->>C: Broadcast deletion signal
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • Hyun0828
  • leesumin0526

Poem

풋풋한 새싹 옆에 내 이름 살짝,
찰칵 지운 채팅엔 “DELETE_” 딱딱!
냄비들 줄 맞춰 빠이빠이 하니,
주인 바꿀 냄비는 잠시 멈칫-딱!
오늘도 코드밭 파는 토끼 하나,
폴짝폴짝 PR 위에 춤을 춘다. 🥕✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40edb56 and f741a5b.

📒 Files selected for processing (20)
  • src/main/java/stackpot/mongo/ChatRepository.java (2 hunks)
  • src/main/java/stackpot/stackpot/apiPayload/code/status/ErrorStatus.java (1 hunks)
  • src/main/java/stackpot/stackpot/chat/converter/ChatConverter.java (2 hunks)
  • src/main/java/stackpot/stackpot/chat/repository/ChatRoomInfoRepository.java (2 hunks)
  • src/main/java/stackpot/stackpot/chat/repository/ChatRoomRepository.java (2 hunks)
  • src/main/java/stackpot/stackpot/chat/service/chat/ChatCommandService.java (1 hunks)
  • src/main/java/stackpot/stackpot/chat/service/chat/ChatSendService.java (1 hunks)
  • src/main/java/stackpot/stackpot/common/util/RoleNameMapper.java (2 hunks)
  • src/main/java/stackpot/stackpot/feed/converter/FeedConverter.java (5 hunks)
  • src/main/java/stackpot/stackpot/pot/converter/PotApplicationConverter.java (2 hunks)
  • src/main/java/stackpot/stackpot/pot/converter/PotCommentConverter.java (3 hunks)
  • src/main/java/stackpot/stackpot/pot/converter/PotMemberConverter.java (2 hunks)
  • src/main/java/stackpot/stackpot/pot/entity/Pot.java (1 hunks)
  • src/main/java/stackpot/stackpot/pot/repository/PotApplicationRepository.java (2 hunks)
  • src/main/java/stackpot/stackpot/pot/repository/PotMemberRepository.java (2 hunks)
  • src/main/java/stackpot/stackpot/pot/repository/PotRecruitmentDetailsRepository.java (1 hunks)
  • src/main/java/stackpot/stackpot/pot/repository/PotRepository.java (2 hunks)
  • src/main/java/stackpot/stackpot/pot/repository/PotSaveRepository.java (1 hunks)
  • src/main/java/stackpot/stackpot/user/entity/User.java (1 hunks)
  • src/main/java/stackpot/stackpot/user/service/UserCommandServiceImpl.java (6 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.

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.

@jjaeroong jjaeroong merged commit 5c30b73 into main Aug 13, 2025
1 of 2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Aug 15, 2025
5 tasks
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.

3 participants