Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough계정 탈퇴 API 연동 기능이 추가되었습니다. 새로운 Changes
Sequence Diagram(s)sequenceDiagram
participant User as "사용자 (UI)"
participant Screen as "SettingsMyDataScreen"
participant VM as "SettingsMyDataViewModel"
participant Repo as "MemberDeleteRepository"
participant Service as "MemberDeleteService (Ktorfit)"
participant Auth as "Auth (로그아웃)"
User->>Screen: 탈퇴 버튼 클릭
Screen->>VM: deleteUser(onSuccess, onError)
VM->>Repo: deleteMember()
Repo->>Service: DELETE /member
Service-->>Repo: HTTP 200 / 응답
Repo-->>VM: Result.success
VM->>VM: onSuccess 콜백 호출
VM->>Auth: logout()
Auth-->>VM: logout 성공
VM-->>Screen: navigateToLoginAfterLogout()
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt`:
- Around line 11-13: The method currently wraps
memberDeleteService.deleteMember() in runCatching but returns Result<Unit>,
causing a mismatch and not propagating HTTP errors; change the implementation in
MemberDeleteRepositoryImpl.deleteMember to call .handleNullableResponse() on the
Response before wrapping so the HTTP errors are converted/propagated and the
result becomes Unit (for example: runCatching {
memberDeleteService.deleteMember().handleNullableResponse() }), ensuring the
function returns Result<Unit>.
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.kt`:
- Around line 80-93: The empty failure callbacks for onServiceWithdrawClick
(calls to viewModel.deleteUser and nested viewModel.logout) swallow errors and
break user flow; implement onError handlers for viewModel.deleteUser and
viewModel.logout to handle failures (e.g., display an error UI/message, keep
showLogoutDialog true to avoid closing the dialog prematurely, and avoid
navigating via navigateToLoginAfterLogout on logout failure) and ensure any
necessary local cleanup is still done or retried; update the onError lambdas in
the deleteUser and logout calls to call the viewModel/error-dispatch method or
UI toast/snackbar and to preserve correct dialog/navigation state (referencing
onServiceWithdrawClick, viewModel.deleteUser, viewModel.logout,
showLogoutDialog, navigateToLoginAfterLogout).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2aa7519e-e5ac-453b-94fd-a9a58d319a28
📒 Files selected for processing (7)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/member/MemberDeleteService.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/di/ApiModule.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/MemberDeleteRepository.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/viewmodel/SettingsMyDataViewModel.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/subscription/screen/SettingsSubscriptionScreen.kt
💤 Files with no reviewable changes (1)
- composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/subscription/screen/SettingsSubscriptionScreen.kt
| onServiceWithdrawClick = { | ||
| viewModel.deleteUser( | ||
| onSuccess = { | ||
| viewModel.logout( | ||
| onSuccess = { | ||
| showLogoutDialog = false | ||
| navigateToLoginAfterLogout() | ||
| }, | ||
| onError = { error -> | ||
| }, | ||
| ) | ||
| }, | ||
| onError = {}, | ||
| ) |
There was a problem hiding this comment.
실패 콜백이 비어 있어 탈퇴/로그아웃 실패 시 사용자 흐름이 끊깁니다.
Line 88-89, Line 92에서 onError를 비워두면 실패가 완전히 무시됩니다. 특히 로그아웃은 로컬 토큰이 이미 정리될 수 있어(관련 구현상) 화면만 남는 불일치 상태가 생길 수 있습니다.
🩹 최소 보완안
onServiceWithdrawClick = {
viewModel.deleteUser(
onSuccess = {
viewModel.logout(
onSuccess = {
showLogoutDialog = false
navigateToLoginAfterLogout()
},
- onError = { error ->
- },
+ onError = { _ ->
+ // 로컬 세션 정리 상태와 UI 상태를 맞춤
+ showLogoutDialog = false
+ navigateToLoginAfterLogout()
+ },
)
},
- onError = {},
+ onError = { _ ->
+ // TODO: 스낵바/다이얼로그 등 사용자 피드백 연결
+ },
)
},🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.kt`
around lines 80 - 93, The empty failure callbacks for onServiceWithdrawClick
(calls to viewModel.deleteUser and nested viewModel.logout) swallow errors and
break user flow; implement onError handlers for viewModel.deleteUser and
viewModel.logout to handle failures (e.g., display an error UI/message, keep
showLogoutDialog true to avoid closing the dialog prematurely, and avoid
navigating via navigateToLoginAfterLogout on logout failure) and ensure any
necessary local cleanup is still done or retried; update the onError lambdas in
the deleteUser and logout calls to call the viewModel/error-dispatch method or
UI toast/snackbar and to preserve correct dialog/navigation state (referencing
onServiceWithdrawClick, viewModel.deleteUser, viewModel.logout,
showLogoutDialog, navigateToLoginAfterLogout).
🔗 관련 이슈
📙 작업 설명
Summary by CodeRabbit
릴리스 노트
새로운 기능
리팩토링