Conversation
🎭 Playwright Report✨ E2E Test가 성공적으로 완료되었습니다. Test 요약 내용을 확인해주세요.
📊 Test Summary
📜 Test Details✅ Passed Tests (3)
|
🎨 Storybook Report✅ 변경 사항이 없습니다 모든 Story가 이전 빌드와 동일합니다.
|
|
Important Review skippedAuto 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 Use the checkbox below for a quick retry:
WalkthroughNext.js 의존성을 16.0.10에서 16.1.6으로 업데이트하고, API 모듈 구조를 재정렬했습니다. 핵심 API 인터페이스의 재내보내기를 제거하고 서비스 파일들의 import 경로를 업데이트했으며, 인증 및 기본 인터셉터의 에러 처리 로직을 조정했습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
🚀 PR Preview Report✨ Build가 성공적으로 완료되었습니다. Preview에서 변경사항을 확인하세요.
|
📊 Coverage Report
📉 #387을 main에 병합하면 coverage가 Coverage 요약@@ Coverage Diff @@
## main #387 +/- ##
===========================================
- Coverage 35.69% 35.68% -0.01%
===========================================
Files 263 262 -1
Lines 12141 12140 -1
Branches 477 477 0
===========================================
- Hits 4334 4332 -2
+ Misses 7807 7808 +1 영향받은 파일
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/api/core/base/index.ts (1)
40-43: 401 리다이렉트 이후throw실행 방지 수정 확인
window.location.href설정 후return;을 추가하여 Line 53의throw errorResponse가 실행되지 않도록 한 수정은 올바릅니다.다만,
return;은 Axios 인터셉터 Promise를undefined로 resolve 시킵니다. 페이지 이동 속도가 느린 환경에서await baseAPI.someMethod()의 반환값을 사용하는 코드가 이어 실행될 경우, 에러 없이undefined를 받아TypeError가 발생할 수 있습니다. 리다이렉트 중 이후 코드가 아예 실행되지 않도록 절대 settle되지 않는 Promise를 반환하는 방법도 고려할 수 있습니다.💡 선택적 개선안
window.location.href = `/login?error=unauthorized&path=${encodeURIComponent(currentPath)}`; - return; + return new Promise(() => {});🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/api/core/base/index.ts` around lines 40 - 43, 현재 Axios 응답 인터셉터에서 401 발생 시 window.location.href 설정 후 단순히 `return;` 하면 Promise가 정상 resolve(undefined)되어 이후 `await baseAPI.someMethod()` 호출 코드가 계속 실행되어 TypeError를 일으킬 수 있으므로, 401 처리 분기(인터셉터 코드에서 `window.location.href = ...` 직후)에 단순 return 대신 절대 settle되지 않는 Promise를 반환하도록 바꿔 인터셉터가 후속 코드로 이어지지 않게 하세요; 예시로 해당 분기에서 `return new Promise(() => {})`를 반환하도록 변경하여 `errorResponse`를 throw 하거나 undefined를 반환해 후속 코드가 실행되는 상황을 모두 방지하세요 (참조 심볼: axios 응답 인터셉터, errorResponse, baseAPI.someMethod()).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 57: Update the devDependency "eslint-config-next" to match the "next"
version (change "eslint-config-next" from 16.0.1 to 16.1.6) so both packages use
the same version; after updating the "eslint-config-next" entry in package.json,
run your package manager (npm/yarn/pnpm) to reinstall and update the lockfile to
ensure ESLint rules align with Next.js.
---
Nitpick comments:
In `@src/api/core/base/index.ts`:
- Around line 40-43: 현재 Axios 응답 인터셉터에서 401 발생 시 window.location.href 설정 후 단순히
`return;` 하면 Promise가 정상 resolve(undefined)되어 이후 `await baseAPI.someMethod()` 호출
코드가 계속 실행되어 TypeError를 일으킬 수 있으므로, 401 처리 분기(인터셉터 코드에서 `window.location.href =
...` 직후)에 단순 return 대신 절대 settle되지 않는 Promise를 반환하도록 바꿔 인터셉터가 후속 코드로 이어지지 않게
하세요; 예시로 해당 분기에서 `return new Promise(() => {})`를 반환하도록 변경하여 `errorResponse`를
throw 하거나 undefined를 반환해 후속 코드가 실행되는 상황을 모두 방지하세요 (참조 심볼: axios 응답 인터셉터,
errorResponse, baseAPI.someMethod()).
📝 변경 사항
Axios 리팩토링 후속 버그픽스 변경사항
커밋 히스토리
0bce8cb5d957a1489ef5245acf5292a945d1. chat-service
createDMChatRoomURL 프리픽스 누락 수정/chat/dm→/api/v1/chat/dm으로 수정.2. Next.js 보안 취약점 개선을 위한 버전 업데이트
package.json에서 Next.js 버전 업데이트:16.0.10→16.1.6기존 사용 중이던 Next.js 16.0.x에 아래 CVE가 존재하여 즉시 업그레이드 진행.
3. authAPI - 에러 응답
return→throw수정src/api/core/auth/index.ts의 response interceptor에서 에러 응답을return하던 것을throw로 수정.4. 순환참조 해결 - Barrel Export 파일 삭제
src/api/core/index.ts(re-export 파일) 삭제 및 모든 서비스에서 직접 경로로 import하도록 변경.순환참조 발생 원인
해결 방법
core/index.ts(Barrel Export) 삭제 후, 각 서비스에서 직접 경로로 import.영향받은 파일
@/api/core@/api/core/auth@/api/core@/api/core/base@/api/core@/api/core/base@/api/core@/api/core/base@/api/core@/api/core/base@/api/core@/api/core/base5. baseAPI -
window.location.href이후return추가src/api/core/base/index.ts의 401 에러 처리에서window.location.href리다이렉트 이후return문을 추가하여 이후 코드(throw errorResponse)가 실행되지 않도록 수정.변경된 파일 목록
package.jsonpnpm-lock.yamlsrc/api/core/index.tssrc/api/core/auth/index.tssrc/api/core/base/index.tssrc/api/service/auth-service/index.tssrc/api/service/chat-service/index.tssrc/api/service/follower-service/index.tssrc/api/service/group-service/index.tssrc/api/service/notification-service/index.tssrc/api/service/user-service/index.ts🔗 관련 이슈
Closes #
🧪 테스트 방법
📸 스크린샷 (선택)
📋 체크리스트
💬 추가 코멘트
CodeRabbit Review는 자동으로 실행되지 않습니다.
Review를 실행하려면 comment에 아래와 같이 작성해주세요
Summary by CodeRabbit
릴리스 노트
업데이트
버그 수정