Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 개요이 변경사항은 날짜별 피드백을 조회하고 표시하는 새로운 기능을 추가합니다. API 계층에 시퀀스 다이어그램sequenceDiagram
participant User
participant DailyFeedbackView as DailyFeedbackView.vue
participant useFeedbackList as useFeedbackList Composable
participant Service as assistantService
participant API as api.js
participant Backend
User->>DailyFeedbackView: 날짜 선택
DailyFeedbackView->>useFeedbackList: selectedDate 변경 감지
useFeedbackList->>useFeedbackList: fetchFeedbacksAsMessageForm(date) 실행
useFeedbackList->>Service: getFeedbacks(date)
Service->>API: getFeedbacksApi(date)
API->>Backend: GET /v1/assistants/feedbacks/daily/${date}
Backend-->>API: feedbacks 데이터 반환
API-->>Service: axios 응답 반환
Service-->>useFeedbackList: res.data 반환
alt 성공 (피드백 있음)
useFeedbackList->>useFeedbackList: user/system 메시지 교대로 구성
useFeedbackList->>DailyFeedbackView: messages 배열 업데이트
DailyFeedbackView->>User: Messages 컴포넌트 렌더링
else 성공 (피드백 없음)
useFeedbackList->>useFeedbackList: nomessages 메시지 설정
DailyFeedbackView->>User: 콘텐츠 없음 메시지 표시
else 에러 (INVALID_REQUEST)
useFeedbackList->>useFeedbackList: 에러 메시지 설정
DailyFeedbackView->>User: 에러 메시지 표시
end
예상 코드 리뷰 노력🎯 3 (Moderate) | ⏱️ ~20-25 minutes 분석:
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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.
Actionable comments posted: 10
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
front/src/features/assistant/api.js(1 hunks)front/src/features/assistant/assistantService.js(1 hunks)front/src/features/assistant/constants.js(1 hunks)front/src/features/assistant/useFeedbackForm.js(2 hunks)front/src/features/assistant/useFeedbackList.js(1 hunks)front/src/features/assistant/views/DailyFeedbackView.vue(1 hunks)front/src/shared/utils/errorUtils.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
front/src/features/assistant/useFeedbackForm.js (1)
front/src/features/assistant/constants.js (2)
REQ_ERR_MESSAGES(44-46)REQ_ERR_MESSAGES(44-46)
front/src/features/assistant/api.js (1)
front/src/features/assistant/assistantService.js (2)
getFeedbacks(21-27)getFeedbacks(21-27)
front/src/features/assistant/assistantService.js (2)
front/src/features/assistant/api.js (2)
getFeedbacks(11-13)getFeedbacks(11-13)front/src/shared/utils/errorUtils.js (1)
wrapApi(41-49)
front/src/shared/utils/errorUtils.js (1)
front/src/features/auth/password.js (1)
message(11-12)
front/src/features/assistant/useFeedbackList.js (3)
front/src/features/assistant/constants.js (2)
LIST_ERR_MESSAGES(39-42)LIST_ERR_MESSAGES(39-42)front/src/features/assistant/assistantService.js (5)
res(12-12)res(17-17)res(23-23)getFeedbacks(21-27)getFeedbacks(21-27)front/src/features/assistant/api.js (2)
getFeedbacks(11-13)getFeedbacks(11-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (5)
front/src/features/assistant/useFeedbackForm.js (1)
3-3: LGTM — 에러 메시지 사전 의존성 주입.에러코드 기반 메시지 확장을 위해
REQ_ERR_MESSAGES를 가져오는 변경은 타당합니다.front/src/features/assistant/useFeedbackList.js (2)
64-71: 초기 데이터 로딩을 명시적으로 처리하세요.
onMounted에서selectedDate를 설정하지만fetchFeedbacksAsMessageForm을 직접 호출하지 않고watch에만 의존하고 있습니다.다음 사항을 확인하세요:
selectedDate가 이미 해당 값으로 설정되어 있으면watch가 트리거되지 않아 데이터가 로드되지 않을 수 있습니다.- 초기 렌더링 시 데이터 로딩이 항상 발생하는지 검증이 필요합니다.
명시적으로 fetch를 호출하는 것을 고려하세요:
onMounted(() => { const routeDate = route.params.date if (routeDate) { selectedDate.value = parseYMD(routeDate) router.replace({ name: 'daily-feedback-list' }) + fetchFeedbacksAsMessageForm(selectedDate.value) + } else { + fetchFeedbacksAsMessageForm(selectedDate.value) } })
45-45: XSS 취약점 우려는 부당합니다. 적절한 위협 완화가 이미 구현되어 있습니다.검증 결과,
txt필드는v-html로 렌더링되기 전에parseMdToHtmlAndSanitize()함수를 통해 처리됩니다. 이 함수는DOMPurify.sanitize()를 사용하여 모든 HTML을 정제하므로, 사용자 입력은 위험한 스크립트나 이벤트 핸들러로부터 안전합니다. 따라서 현재 구현은 XSS 공격으로부터 보호되어 있습니다.front/src/shared/utils/errorUtils.js (2)
23-23: code가 undefined일 때의 동작을 확인하세요.모든 에러 경로에서
e.code = code를 할당하고 있습니다.code가 응답에 없는 경우undefined가 할당됩니다.의도된 동작인지 확인하세요:
- 현재:
e.code는 항상 존재하며, 값이 없으면undefined입니다.- 대안:
code가 존재할 때만 설정하여 속성 자체가 없도록 할 수 있습니다.
code가 존재할 때만 설정하려면:const e = new Error(dataMsg || fallbackMessage) e.fieldErrors = fieldErrors - e.code = code + if (code) e.code = code return e모든 에러 경로에 동일하게 적용하세요. 그러나 일관성을 위해 현재 방식(항상 설정)도 유효한 선택입니다.
Also applies to: 31-31, 37-37
41-49: 변경 사항이 적절합니다.
wrapApi함수의 포맷팅 변경은 코드 가독성을 유지하면서 일관된 스타일을 따릅니다.
#️⃣연관된 이슈
변경 타입
변경 내용
체크리스트
코멘트
Summary by CodeRabbit
새로운 기능
개선사항
리팩토링