Skip to content

[FIX/#311] 매칭 신청 후 데이터 재호출 수정#313

Merged
vahkjsdf merged 4 commits into
developfrom
fix/#311-user_profile_api_reload
Apr 9, 2026
Merged

[FIX/#311] 매칭 신청 후 데이터 재호출 수정#313
vahkjsdf merged 4 commits into
developfrom
fix/#311-user_profile_api_reload

Conversation

@vahkjsdf

@vahkjsdf vahkjsdf commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Related issue 🛠

Work Description ✏️

  • 매칭 신청 후 데이터를 재호출합니다.

Screenshot 📸

Screen_Recording_20260409_181747_debug.mp4

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

  • 세상에 버튼 활성화 여부 처리 안해줘도 되는거였군요 신경쓰지 마십시오 다들 맛저하세용

Summary by CodeRabbit

릴리스 노트

  • 버그 수정

    • 다른 사용자와의 경쟁을 신청한 후 프로필 정보가 자동으로 업데이트되어 항상 최신 상태를 유지하도록 개선했습니다.
  • 리팩토링

    • 사용자 프로필 상태 관리 관련 내부 코드를 정리했습니다.

@vahkjsdf vahkjsdf self-assigned this Apr 9, 2026
@vahkjsdf vahkjsdf added the 🔨 FIX 버그 수정 label Apr 9, 2026
@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0a424d45-f3b5-4868-931e-82e3e43eb033

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

매칭 신청 후 프로필 정보를 재호출하기 위해 UserProfileViewModel.requestCompetition()fetchProfileInfo() 호출을 추가하고, isMatchingRequest 필드를 isMatchingPossible로 이름 변경했습니다.

Changes

Cohort / File(s) Summary
State 필드 이름 변경
app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileContract.kt
isMatchingRequest 필드를 isMatchingPossible로 이름 변경하여 상태 의미를 명확히 함.
ViewModel 로직 추가
app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileViewModel.kt
requestCompetition() 메서드에서 postMatching() 성공 후 fetchProfileInfo() 호출을 추가하여 매칭 상태 갱신; 주석 처리된 상태 업데이트 포함.
UI 조건 추가
app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileScreen.kt
대체 활성화 조건 uiState.isChallengeable && uiState.isMatchingPossible을 주석 처리하여 향후 참고용으로 포함.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ShinHyeongcheol
  • seungjunGong
  • oilbeaneda
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 매칭 신청 후 데이터 재호출 수정이라는 주요 변경 사항을 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed PR은 연결된 이슈 #311의 주요 목표인 userprofile 데이터 재호출을 구현했습니다. requestCompetition() 성공 후 fetchProfileInfo()를 호출하도록 수정되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #311의 범위 내에 있습니다. UserProfileContract, UserProfileScreen, UserProfileViewModel의 변경은 모두 데이터 재호출 기능 구현과 관련이 있습니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 모두 따르고 있으며, 관련 이슈, 작업 내용, 스크린샷, 미완료 항목, 검토자 요청이 모두 포함되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#311-user_profile_api_reload

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a56ecdf and 77df2d5.

📒 Files selected for processing (3)
  • app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileContract.kt
  • app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileScreen.kt
  • app/src/main/java/com/smashing/app/presentation/profile/userprofile/UserProfileViewModel.kt

@seungjunGong seungjunGong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿!

@oilbeaneda oilbeaneda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

짱!!!!!

@ShinHyeongcheol ShinHyeongcheol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뀼뀼

@vahkjsdf vahkjsdf merged commit eb3cfbd into develop Apr 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 FIX 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 매칭 신청 후 데이터 재호출 수정

4 participants