[FIX/#311] 매칭 신청 후 데이터 재호출 수정#313
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough매칭 신청 후 프로필 정보를 재호출하기 위해 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 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 unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileViewModel.kt (1)
236-236:⚠️ Potential issue | 🟠 Major매칭 실패 시에도 완료 다이얼로그가 열립니다.
Line 236의
showDialog()가 성공 여부와 무관하게 실행됩니다. 성공 케이스 내부에서만 호출되도록 이동해야 합니다.수정 예시
fun requestCompetition() { viewModelScope.launch { _uiState.update { it.copy(loadState = UserProfileUiState.Loading) } matchingRepository.postMatching( receiverProfileId = _uiState.value.selectedSportProfileId ).onSuccess { _uiState.update { currentState -> currentState.copy( loadState = UserProfileUiState.Success, //isMatchingPossible = false ) } fetchProfileInfo() + showDialog() }.onFailure { exception -> _uiState.update { it.copy( loadState = UserProfileUiState.Failure( exception.message ?: "오류 발생", ) ) } } } - showDialog() }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileViewModel.kt` at line 236, The call to showDialog() is currently executed unconditionally, causing the completion dialog to appear even on matching failures; move the showDialog() invocation so it is only called inside the success branch of the match result handling (the success callback / when handling a successful response in UserProfileViewModel), and remove it from the failure/error path so only the success case triggers showDialog(); locate the unconditional showDialog() call and place it within the block that handles successful matches (e.g., the success branch of the match API response handler) and ensure failure branches do not call it.
🧹 Nitpick comments (2)
app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileContract.kt (1)
22-22:isMatchingPossible상태의 책임 범위를 명확히 해주세요.Line 22 필드가 추가/변경되었지만 현재 흐름에서는 실질 갱신·사용 경로가 보이지 않아 상태 모델이 중복 의미를 가집니다. 서버 응답(
isChallengeable)만 신뢰할 계획이면 제거하고, 클라이언트 보조 상태로 쓸 계획이면 ViewModel 갱신 로직과 화면 반영을 함께 연결해 주세요.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileContract.kt` at line 22, isMatchingPossible 상태가 중복 의미를 갖고 실제 갱신·사용 경로가 없어 모호하니 책임을 명확히 하세요: 만약 서버 응답(isChallengeable)을 신뢰할 계획이면 UserProfileContract.State에서 isMatchingPossible을 제거하고 View와 ViewModel에서 isChallengeable만 사용하도록 제거 및 참조 정리하세요; 반대로 클라이언트 보조 상태로 유지할 계획이면 UserProfileViewModel(예: updateProfile / loadProfile 로직)에서 isMatchingPossible을 갱신하는 명확한 경로를 추가하고 그 값을 화면 렌더링 함수(예: renderProfile / observeProfile 상태 바인딩)로 연결해 UI에 반영되도록 수정하세요.app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileScreen.kt (1)
175-175: 주석으로 남겨둔 버튼 활성 조건은 정리해 주세요.Line 175의 대체 로직 주석은 실제 정책과 다를 때 오해를 만들기 쉽습니다. 적용 예정이면 TODO+이슈 번호로 명시하고, 아니라면 제거해서 활성 조건의 단일 기준을 유지하는 편이 좋습니다.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileScreen.kt` at line 175, 주석 처리된 활성화 조건 'isCompeteEnabled = uiState.isChallengeable && uiState.isMatchingPossible'이 실제 정책과 다르면 혼란을 유발하니 UserProfileScreen.kt에서 해당 주석을 제거하거나, 실제로 적용할 예정이라면 주석을 TODO + 이슈 번호(예: TODO: `#1234`)로 명확히 표시하고 관련 정책/이슈 링크를 남기도록 수정하세요; 참조 심볼: isCompeteEnabled, uiState.isChallengeable, uiState.isMatchingPossible.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileViewModel.kt`:
- Line 236: The call to showDialog() is currently executed unconditionally,
causing the completion dialog to appear even on matching failures; move the
showDialog() invocation so it is only called inside the success branch of the
match result handling (the success callback / when handling a successful
response in UserProfileViewModel), and remove it from the failure/error path so
only the success case triggers showDialog(); locate the unconditional
showDialog() call and place it within the block that handles successful matches
(e.g., the success branch of the match API response handler) and ensure failure
branches do not call it.
---
Nitpick comments:
In
`@app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileContract.kt`:
- Line 22: isMatchingPossible 상태가 중복 의미를 갖고 실제 갱신·사용 경로가 없어 모호하니 책임을 명확히 하세요: 만약
서버 응답(isChallengeable)을 신뢰할 계획이면 UserProfileContract.State에서 isMatchingPossible을
제거하고 View와 ViewModel에서 isChallengeable만 사용하도록 제거 및 참조 정리하세요; 반대로 클라이언트 보조 상태로
유지할 계획이면 UserProfileViewModel(예: updateProfile / loadProfile 로직)에서
isMatchingPossible을 갱신하는 명확한 경로를 추가하고 그 값을 화면 렌더링 함수(예: renderProfile /
observeProfile 상태 바인딩)로 연결해 UI에 반영되도록 수정하세요.
In
`@app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileScreen.kt`:
- Line 175: 주석 처리된 활성화 조건 'isCompeteEnabled = uiState.isChallengeable &&
uiState.isMatchingPossible'이 실제 정책과 다르면 혼란을 유발하니 UserProfileScreen.kt에서 해당 주석을
제거하거나, 실제로 적용할 예정이라면 주석을 TODO + 이슈 번호(예: TODO: `#1234`)로 명확히 표시하고 관련 정책/이슈 링크를
남기도록 수정하세요; 참조 심볼: isCompeteEnabled, uiState.isChallengeable,
uiState.isMatchingPossible.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c5e3b890-1e66-438a-8591-88605366f613
📒 Files selected for processing (3)
app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileContract.ktapp/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileScreen.ktapp/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileViewModel.kt
Related issue 🛠
Work Description ✏️
Screenshot 📸
Screen_Recording_20260409_181747_debug.mp4
Uncompleted Tasks 😅
To Reviewers 📢
Summary by CodeRabbit
릴리스 노트
버그 수정
리팩토링