Conversation
|
@coderabbitai 리뷰 부탁해 |
|
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthrough이 풀 리퀘스트는 MSW(Mock Service Worker) 인프라를 제거하고 채팅 시스템을 실제 WebSocket API로 마이그레이션합니다. WebSocket URL 경로를 Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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)
frontend/src/libs/websocket/hooks/useWebSocket.ts (1)
67-72: WebSocket 오류 핸들러에서onError콜백 호출 검토 필요
onWebSocketError에서 WebSocket 레벨 오류 발생 시onErrorRef.current를 호출하지 않습니다.onStompError에서는onErrorRef.current를 호출하는데, WebSocket 오류도 클라이언트에게 알려야 할 수 있습니다.의도적으로 구분한 것이라면 무시해도 됩니다.
선택적 개선 제안
onWebSocketError: (event) => { console.error('[WS] WebSocket 오류:', event); + // WebSocket 레벨 오류도 클라이언트에 전파할 경우 + // onErrorRef.current?.(event as never); },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/libs/websocket/hooks/useWebSocket.ts` around lines 67 - 72, The WebSocket-level error handler onWebSocketError currently only logs to console but does not notify the consumer; update onWebSocketError to invoke the shared error callback (onErrorRef.current) like onStompError does, e.g., check onErrorRef.current and call it with the event (or a normalized Error object) so client code receives WebSocket errors; use the same safety pattern used elsewhere (null-check/optional chaining and try/catch) as in onStompError to avoid throwing from the handler.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@frontend/src/libs/websocket/hooks/useWebSocket.ts`:
- Around line 67-72: The WebSocket-level error handler onWebSocketError
currently only logs to console but does not notify the consumer; update
onWebSocketError to invoke the shared error callback (onErrorRef.current) like
onStompError does, e.g., check onErrorRef.current and call it with the event (or
a normalized Error object) so client code receives WebSocket errors; use the
same safety pattern used elsewhere (null-check/optional chaining and try/catch)
as in onStompError to avoid throwing from the handler.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e11b1429-da3a-4012-a0ac-58fe037d8f61
📒 Files selected for processing (13)
frontend/src/domains/chat/hooks/useChat.tsfrontend/src/domains/chat/types/api.types.tsfrontend/src/domains/chat/types/chat.types.tsfrontend/src/index.tsxfrontend/src/libs/websocket/hooks/__tests__/useWebSocket.test.tsfrontend/src/libs/websocket/hooks/useWebSocket.tsfrontend/src/mocks/browser.tsfrontend/src/mocks/handlers.tsfrontend/src/mocks/handlers/chat.tsfrontend/src/mocks/node.tsfrontend/src/pages/RoutieSpace/RoutieSpace.tsxfrontend/src/pages/RoutieSpace/components/ChatView/ChatView.tsxfrontend/src/pages/RoutieSpace/components/ChatView/ChatView.types.ts
💤 Files with no reviewable changes (5)
- frontend/src/mocks/browser.ts
- frontend/src/mocks/handlers.ts
- frontend/src/mocks/node.ts
- frontend/src/libs/websocket/hooks/tests/useWebSocket.test.ts
- frontend/src/mocks/handlers/chat.ts
As-Is
To-Be
msw 대신 구현된 api를 활용하도록 수정
Check List
Test Screenshot
(Optional) Additional Description
Closes #1120
Summary by CodeRabbit
릴리스 노트
버그 수정
개선 사항