Skip to content

fix: 채팅 메시지 발행 시 명세에 따라 routieSpaceId 필드 추가#1117

Merged
AHHYUNJU merged 2 commits intodevelopfrom
fix/publish-bug-#1112
Apr 2, 2026
Merged

fix: 채팅 메시지 발행 시 명세에 따라 routieSpaceId 필드 추가#1117
AHHYUNJU merged 2 commits intodevelopfrom
fix/publish-bug-#1112

Conversation

@AHHYUNJU
Copy link
Copy Markdown
Contributor

@AHHYUNJU AHHYUNJU commented Apr 2, 2026

As-Is

To-Be

  • 채팅 메시지 발행 시 명세에 따라 routieSpaceId 필드 추가

Check List

  • 테스트가 전부 통과되었나요?
  • 모든 commit이 push 되었나요?
  • merge할 branch를 확인했나요?
  • Assignee를 지정했나요?
  • Label을 지정했나요?

Test Screenshot

(Optional) Additional Description

Closes #1112

Summary by CodeRabbit

버그 수정

  • 채팅 메시지 전송이 현재 활성 공간을 정확히 식별하도록 개선되었습니다.
  • 공간 변경 시 메시지 전송 기능이 안정적으로 업데이트됩니다.

@github-actions github-actions Bot requested review from aydenote, jeongyou and ohgus April 2, 2026 07:16
@github-actions github-actions Bot added fix 버그 수정 frontend 프론트 작업 labels Apr 2, 2026
@AHHYUNJU
Copy link
Copy Markdown
Contributor Author

AHHYUNJU commented Apr 2, 2026

@coderabbitai 리뷰 부탁해

@meolichae meolichae moved this to In Progress in 2025-routie Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

@AHHYUNJU 네, PR #1117 리뷰를 시작하겠습니다! 🐰


🧠 Learnings used
Learnt from: CR
Repo: woowacourse-teams/2025-routie PR: 0
File: frontend/src/domains/routieSpace/AGENT.md:0-0
Timestamp: 2026-02-02T07:30:58.208Z
Learning: Applies to frontend/src/domains/routieSpace/src/domains/routieSpace/{apis,queries,hooks}/*.ts : Ensure error messages in routieSpace domain are in Korean (한글)

Learnt from: CR
Repo: woowacourse-teams/2025-routie PR: 0
File: frontend/src/domains/routieSpace/CLAUDE.md:0-0
Timestamp: 2026-03-23T04:21:03.313Z
Learning: Applies to frontend/src/domains/routieSpace/src/domains/routieSpace/**/*.{ts,tsx} : All error messages in routieSpace domain must be in Korean
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

📝 Walkthrough

Walkthrough

frontend/src/domains/chat/hooks/useChat.tssendMessage 함수가 업데이트되었습니다. WebSocket 'CHAT' 메시지 페이로드에 routieSpaceId: routieSpaceUuid 필드가 추가되었으며, 기존의 { tempId, content } 데이터와 함께 전송됩니다. 또한 useCallback의 의존성 배열이 확장되어 routieSpaceUuid가 포함되었으므로, 룸 식별자가 변경될 때 콜백이 업데이트됩니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 명세에 따라 routieSpaceId 필드 추가라는 변경사항을 명확하게 설명하고 있습니다.
Description check ✅ Passed PR 설명이 To-Be 섹션을 포함하고 있으며, 체크리스트 항목이 완료되었고, 이슈 번호가 명시되어 있습니다.
Linked Issues check ✅ Passed 코드 변경사항이 이슈 #1112의 목표인 명세 누락 항목(routieSpaceId 필드) 추가를 정확하게 구현하고 있습니다.
Out of Scope Changes check ✅ Passed 모든 코드 변경사항이 routieSpaceId 필드 추가라는 이슈 범위 내에 있으며, 범위 외 변경사항이 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/publish-bug-#1112

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/domains/chat/hooks/useChat.ts`:
- Line 91: The ChatSendRequest type is missing the routieSpaceId field while
useChat.ts calls send({ type: 'CHAT', routieSpaceId: routieSpaceUuid, tempId,
content }); — update the ChatSendRequest interface (in the API types) to include
routieSpaceId: string (or the correct UUID type) and any optionality if
applicable, then ensure the send(...) call still conforms to the updated
ChatSendRequest signature (verify in the send function/type usage that
routieSpaceId is accepted).
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4594681c-4865-43de-869a-3cdc6a5401a6

📥 Commits

Reviewing files that changed from the base of the PR and between dd01268 and b723665.

📒 Files selected for processing (1)
  • frontend/src/domains/chat/hooks/useChat.ts

}

const isSent = send({ type: 'CHAT', tempId, content });
const isSent = send({ type: 'CHAT', routieSpaceId: routieSpaceUuid, tempId, content });
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# CHAT 발행 payload와 ChatSendRequest 타입 동기화 여부 점검
rg -n --type ts -C2 "interface ChatSendRequest|routieSpaceId|type:\s*'CHAT'" frontend/src/domains/chat
rg -n --type ts -C2 "send\(\{\s*type:\s*'CHAT'" frontend/src/domains/chat

Repository: woowacourse-teams/2025-routie

Length of output: 1537


ChatSendRequest 타입 정의에 routieSpaceId 필드를 추가하세요

Line 91에서 routieSpaceId: routieSpaceUuid를 전송하지만, ChatSendRequest 인터페이스( frontend/src/domains/chat/types/api.types.ts )에는 이 필드가 정의되어 있지 않습니다. 타입 정의와 실제 전송 스키마를 일치시켜야 합니다.

제안 변경
diff --git a/frontend/src/domains/chat/types/api.types.ts b/frontend/src/domains/chat/types/api.types.ts
 interface ChatSendRequest {
   type: 'CHAT';
+  routieSpaceId: string;
   tempId: string;
   content: string;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/domains/chat/hooks/useChat.ts` at line 91, The ChatSendRequest
type is missing the routieSpaceId field while useChat.ts calls send({ type:
'CHAT', routieSpaceId: routieSpaceUuid, tempId, content }); — update the
ChatSendRequest interface (in the API types) to include routieSpaceId: string
(or the correct UUID type) and any optionality if applicable, then ensure the
send(...) call still conforms to the updated ChatSendRequest signature (verify
in the send function/type usage that routieSpaceId is accepted).

@AHHYUNJU
Copy link
Copy Markdown
Contributor Author

AHHYUNJU commented Apr 2, 2026

@coderabbitai 변경사항 확인 부탁해

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the changed file
fd 'useChat.ts' --exec cat {}

Length of output: 2989


🏁 Script executed:

#!/bin/bash
# Check the chat type definitions
fd 'api.types.ts' --search-path frontend/src/domains/chat --exec cat {}
fd '*.types.ts' --search-path frontend/src/domains/chat --exec echo "=== {} ===" \; --exec cat {}

Length of output: 839


@AHHYUNJU 변경사항 확인했습니다! ✅

📋 변경사항 요약

파일: frontend/src/domains/chat/hooks/useChat.ts

항목 내용
변경 위치 sendMessage 내부의 send() 호출부
변경 내용 CHAT 발행 페이로드에 routieSpaceId: routieSpaceUuid 필드 추가
의존성 배열 useCallback deps에 routieSpaceUuid 추가

✅ 검토 결과

  1. 타입 안전성: ChatSendRequest 인터페이스에 이미 routieSpaceId: string이 필수 필드로 선언되어 있어, 타입 레벨에서도 일관성이 유지됩니다.

  2. 페이로드 수정: 변경 전에는 { type: 'CHAT', tempId, content }만 전송되어 routieSpaceId가 누락되었으나, 수정 후 { type: 'CHAT', routieSpaceId: routieSpaceUuid, tempId, content }로 명세에 맞게 전송됩니다.

  3. 의존성 배열: routieSpaceUuidsendMessage 콜백에서 사용되므로 deps에 추가한 것은 올바릅니다. 누락 시 stale closure 문제가 발생할 수 있었습니다.

  4. 기타 로직: handleMessage, WebSocket 연결 URL/구독 경로 등 나머지 로직은 변경이 없으며 이상 없습니다.

별도로 지적할 문제점은 없고, 변경사항이 간결하고 명확합니다. 👍


🧠 Learnings used
Learnt from: CR
Repo: woowacourse-teams/2025-routie PR: 0
File: frontend/src/domains/routieSpace/AGENT.md:0-0
Timestamp: 2026-02-02T07:30:58.208Z
Learning: Applies to frontend/src/domains/routieSpace/src/domains/routieSpace/{apis,queries,hooks}/*.ts : Ensure error messages in routieSpace domain are in Korean (한글)

Learnt from: CR
Repo: woowacourse-teams/2025-routie PR: 0
File: frontend/src/domains/routieSpace/CLAUDE.md:0-0
Timestamp: 2026-03-23T04:21:03.313Z
Learning: Applies to frontend/src/domains/routieSpace/src/domains/routieSpace/**/*.{ts,tsx} : All error messages in routieSpace domain must be in Korean

@AHHYUNJU AHHYUNJU merged commit b7ac27a into develop Apr 2, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in 2025-routie Apr 2, 2026
@AHHYUNJU AHHYUNJU deleted the fix/publish-bug-#1112 branch April 2, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 버그 수정 frontend 프론트 작업

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] publish에서 명세에 누락된 부분 추가

2 participants