Skip to content

feat: 방 삭제 알림을 개인 큐로 전송#111

Merged
parkjuyeong0312 merged 6 commits into
mainfrom
feature/room-delete-private-queue
May 29, 2026
Merged

feat: 방 삭제 알림을 개인 큐로 전송#111
parkjuyeong0312 merged 6 commits into
mainfrom
feature/room-delete-private-queue

Conversation

@parkjuyeong0312
Copy link
Copy Markdown
Member

@parkjuyeong0312 parkjuyeong0312 commented May 29, 2026

변경 내용

  • 방 삭제 이벤트 처리 시 방 lifecycle topic 브로드캐스트를 중단하고, 삭제 시점의 활성 멤버별 /user/queue/rooms 개인 큐로 ROOM_DELETED 액션을 전송하도록 변경했습니다.
  • 기존 RoomLifecyclePayload/RoomLifecycleType을 제거하고, 공통 UserRoomActionPayload/UserRoomActionType.ROOM_DELETED 흐름을 사용하도록 정리했습니다.
  • 방 삭제 개인 큐 전송 테스트와 관련 기능 명세/설계 문서를 갱신했습니다.

변경 이유

  • 방 목록 화면이나 재연결 직후처럼 방별 lifecycle topic을 구독하지 않는 상태에서도 방 삭제 사실을 실시간으로 받을 수 있게 하기 위해서입니다.
  • 추방(KICKED)과 방 삭제(ROOM_DELETED)를 같은 유저 단위 방 액션 채널(/user/queue/rooms)에서 처리하도록 realtime 계약을 일관화했습니다.

테스트

  • ./gradlew build
  • /review-code-against-docs 스킬로 검증
  • 그 외 수동 검증: Markdown 충돌 검사

체크리스트

  • PR 제목이 커밋 컨벤션 형식을 따른다.
  • 변경 사유를 PR 설명에 기록했다.
  • 테스트 방법과 결과를 기록했다.
  • 문서 변경이 필요한 경우 반영했다.

하네스 변경 체크리스트

  • CLAUDE.md(AGENTS.md) 변경이 포함되어 있는가?
  • 변경 사유가 PR 설명에 기록되어 있는가?
  • 기존 규칙과 충돌하지 않는가?
  • 팀원에게 변경 사항을 공유했는가?

Summary by CodeRabbit

릴리스 노트

  • 개선

    • 방 삭제 실시간 알림을 개인 알림 큐를 통해 전달하도록 변경
  • 문서

    • 방 삭제 알림 전달 방식 관련 기술 문서 업데이트

Review Change Stack

Copilot AI review requested due to automatic review settings May 29, 2026 13:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@parkjuyeong0312, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8714c4ae-1a45-4c57-a622-d1d81e0bcf6d

📥 Commits

Reviewing files that changed from the base of the PR and between 42df8dd and c7dabe7.

📒 Files selected for processing (2)
  • src/main/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListener.java
  • src/test/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java
📝 Walkthrough

Walkthrough

방 삭제 이벤트 처리에서 활성 멤버들에게 전송되는 실시간 알림의 전달 방식을 변경합니다. 기존 STOMP 브로드캐스트(/topic/rooms/{roomId}/lifecycle)에서 사용자별 개인 큐(/user/queue/rooms)로 전환하고, 리스너와 테스트를 이에 맞게 업데이트합니다.

Changes

방 삭제 알림 개인 큐 전환

Layer / File(s) Summary
설계 및 구현 계획 문서
docs/superpowers/specs/2026-05-29-room-delete-private-queue-design.md, docs/superpowers/plans/2026-05-29-room-delete-private-queue.md, docs/ai/features.md
아키텍처 설계에서 방 삭제 알림을 /user/queue/rooms 개인 큐로 전환하고, 단계별 구현 계획을 제시하며, 기능 문서를 업데이트합니다. RoomDeletedMessageListener가 이벤트 멤버를 순회하여 각 사용자에게 UserRoomActionPayload(actionType=ROOM_DELETED)를 전송하는 흐름을 명시합니다.
RoomDeletedMessageListener 구현 변경
src/main/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListener.java
의존성을 SimpMessagingTemplate에서 UserRoomActionBroadcaster로 변경하고, 핸들러 메서드를 브로드캐스트에서 사용자별 개인 전송으로 리팩터링합니다. 비동기 퍼블리싱 어노테이션을 제거하고 @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) 만 유지합니다.
RoomDeletedMessageListenerTest 업데이트
src/test/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java
테스트를 lifecycle 토픽 브로드캐스트 검증에서 개인 큐 sendToUser 호출 검증으로 전환합니다. 각 활성 멤버에게 roomId, actionType(ROOM_DELETED), message 필드를 가진 페이로드가 전송되는지 검증합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Suggested labels

backend, test

Poem

방 삭제 알림이 모두에게 가던 길
이제 각자 자신의 큐로 찾아가네 🐰
개인 메시지로 더 정중하게 인사하고
브로드캐스트 대신 사용자별 정성 있는 전달 ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 명확하게 요약합니다. 방 삭제 알림 전송 방식을 개인 큐로 변경하는 것이 주요 변경 사항이며, 제목이 이를 정확히 반영합니다.
Description check ✅ Passed PR 설명이 제공된 템플릿의 모든 필수 섹션을 포함하고 있으며, 변경 내용, 변경 이유, 테스트 결과, 체크리스트가 구체적으로 작성되어 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/test/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java (1)

20-20: ⚡ Quick win

사용하지 않는 SimpMessagingTemplate 목과 import를 제거하세요.

리스너가 더 이상 SimpMessagingTemplate에 의존하지 않으므로 이 목과 import는 사용되지 않는 잔여 코드입니다(설계 문서에서도 제거 대상으로 명시됨). 정리하면 테스트 의도가 더 명확해집니다.

♻️ 잔여 코드 제거
-import org.springframework.messaging.simp.SimpMessagingTemplate;
     `@Mock`
     private UserRoomActionBroadcaster userRoomActionBroadcaster;
 
-    `@Mock`
-    private SimpMessagingTemplate messagingTemplate;
-
     `@InjectMocks`
     private RoomDeletedMessageListener listener;

Also applies to: 28-29

🤖 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/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java`
at line 20, Remove the unused SimpMessagingTemplate mock and its import from the
test class RoomDeletedMessageListenerTest: delete the import of
org.springframework.messaging.simp.SimpMessagingTemplate and remove the
corresponding `@Mock` or field declaration (e.g., any SimpMessagingTemplate
simulated instance) and any unused references to it so the test only contains
actual dependencies of RoomDeletedMessageListenerTest.
🤖 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.

Inline comments:
In
`@src/main/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListener.java`:
- Around line 27-28: The loop sending ROOM_DELETED should not let one user's
failure stop others; wrap each call to
userRoomActionBroadcaster.sendToUser(userId, payload) in its own try/catch
inside the iteration (the block iterating event.memberUserIds()), so exceptions
are caught and logged (including userId and the exception) and the loop
continues; update RoomDeletedMessageListener accordingly to preserve best-effort
delivery semantics.

---

Nitpick comments:
In
`@src/test/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java`:
- Line 20: Remove the unused SimpMessagingTemplate mock and its import from the
test class RoomDeletedMessageListenerTest: delete the import of
org.springframework.messaging.simp.SimpMessagingTemplate and remove the
corresponding `@Mock` or field declaration (e.g., any SimpMessagingTemplate
simulated instance) and any unused references to it so the test only contains
actual dependencies of RoomDeletedMessageListenerTest.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ecd8ce3-2f47-421f-92a8-c88388bede3e

📥 Commits

Reviewing files that changed from the base of the PR and between 33e3838 and 42df8dd.

📒 Files selected for processing (7)
  • docs/ai/features.md
  • docs/superpowers/plans/2026-05-29-room-delete-private-queue.md
  • docs/superpowers/specs/2026-05-29-room-delete-private-queue-design.md
  • src/main/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListener.java
  • src/main/java/com/howaboutus/backend/realtime/service/dto/RoomLifecyclePayload.java
  • src/main/java/com/howaboutus/backend/realtime/service/dto/RoomLifecycleType.java
  • src/test/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java
💤 Files with no reviewable changes (2)
  • src/main/java/com/howaboutus/backend/realtime/service/dto/RoomLifecyclePayload.java
  • src/main/java/com/howaboutus/backend/realtime/service/dto/RoomLifecycleType.java

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes room deletion realtime delivery from a room-scoped lifecycle topic to each active member’s personal /user/queue/rooms channel, aligning deletion notifications with the existing user room action flow.

Changes:

  • RoomDeletedMessageListener now sends UserRoomActionPayload(actionType=ROOM_DELETED) to each active member via UserRoomActionBroadcaster.
  • Removed obsolete room lifecycle payload/type DTOs.
  • Updated tests and documentation/spec/plan files for the new private-queue contract.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListener.java Replaces lifecycle topic broadcast with per-user room action sends.
src/main/java/com/howaboutus/backend/realtime/service/dto/RoomLifecyclePayload.java Removes obsolete lifecycle payload DTO.
src/main/java/com/howaboutus/backend/realtime/service/dto/RoomLifecycleType.java Removes obsolete lifecycle enum.
src/test/java/com/howaboutus/backend/messages/listener/RoomDeletedMessageListenerTest.java Verifies each event member receives a ROOM_DELETED user action.
docs/ai/features.md Documents the new /user/queue/rooms deletion notification contract.
docs/superpowers/specs/2026-05-29-room-delete-private-queue-design.md Adds design rationale and realtime contract details.
docs/superpowers/plans/2026-05-29-room-delete-private-queue.md Adds implementation/verification plan for the change.

Copilot AI review requested due to automatic review settings May 29, 2026 13:34
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@parkjuyeong0312 parkjuyeong0312 merged commit 1855a05 into main May 29, 2026
5 checks passed
@parkjuyeong0312 parkjuyeong0312 deleted the feature/room-delete-private-queue branch May 29, 2026 14:52
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