[REFACTOR/#298] userID -> profileId 미반영된 부분 수정#300
Conversation
- `reportedUserId`를 `reportedUserProfileId`로 변경 (reportNavigation.kt, ReportPage, ReportViewModel.kt) - `Ranker` 컴포넌트의 `myUserId` 파라미터를 `userProfileId`로 변경 및 관련 로직 수정 - `SearchInputScreen`에서 불필요한 람다 표현식 정리 및 `navigateToUserProfile` 직접 전달하도록 수정
|
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이 PR은 애플리케이션에서 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@app/src/main/java/com/smashing/app/presentation/ranking/component/RankerItem.kt`:
- Around line 80-85: The lambda onProfileClick currently shadows the outer
userProfileId so the comparison always succeeds and navigateToMyProfile() is
always called; rename the lambda parameter (e.g., targetProfileId) or explicitly
reference the outer property to compare the clicked profile id with the current
user's id, then call navigateToProfile(targetProfileId) when they differ and
navigateToMyProfile() when they are equal; update the onProfileClick declaration
and its uses accordingly to eliminate the shadowing bug.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d309e600-a4f6-47a1-b3dc-04699f6a2be3
📒 Files selected for processing (9)
app/src/main/java/com/smashing/app/data/model/event/UserSummary.ktapp/src/main/java/com/smashing/app/data/remote/dto/event/common/UserSummaryDto.ktapp/src/main/java/com/smashing/app/presentation/home/HomeScreen.ktapp/src/main/java/com/smashing/app/presentation/home/component/CloseMatching.ktapp/src/main/java/com/smashing/app/presentation/ranking/RankingScreen.ktapp/src/main/java/com/smashing/app/presentation/ranking/component/RankerItem.ktapp/src/main/java/com/smashing/app/presentation/report/ReportViewModel.ktapp/src/main/java/com/smashing/app/presentation/report/navigation/reportNavigation.ktapp/src/main/java/com/smashing/app/presentation/search/input/SearchInputScreen.kt
💤 Files with no reviewable changes (3)
- app/src/main/java/com/smashing/app/data/model/event/UserSummary.kt
- app/src/main/java/com/smashing/app/presentation/home/HomeScreen.kt
- app/src/main/java/com/smashing/app/data/remote/dto/event/common/UserSummaryDto.kt
| val onProfileClick: (String) -> Unit = { userProfileId -> | ||
| if (userProfileId != userProfileId) { | ||
| navigateToProfile(userProfileId) | ||
| } else { | ||
| navigateToMyProfile() | ||
| } |
There was a problem hiding this comment.
onProfileClick가 항상 내 프로필로 이동합니다.
람다 파라미터 userProfileId가 바깥의 userProfileId를 가려서, Line 81 비교가 항상 자기 자신과의 비교가 됩니다. 현재 상태로는 상위 랭커를 눌러도 navigateToMyProfile()만 호출됩니다.
수정 예시
- val onProfileClick: (String) -> Unit = { userProfileId ->
- if (userProfileId != userProfileId) {
- navigateToProfile(userProfileId)
+ val onProfileClick: (String) -> Unit = { clickedUserProfileId ->
+ if (clickedUserProfileId != userProfileId) {
+ navigateToProfile(clickedUserProfileId)
} else {
navigateToMyProfile()
}
}🤖 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/ranking/component/RankerItem.kt`
around lines 80 - 85, The lambda onProfileClick currently shadows the outer
userProfileId so the comparison always succeeds and navigateToMyProfile() is
always called; rename the lambda parameter (e.g., targetProfileId) or explicitly
reference the outer property to compare the clicked profile id with the current
user's id, then call navigateToProfile(targetProfileId) when they differ and
navigateToMyProfile() when they are equal; update the onProfileClick declaration
and its uses accordingly to eliminate the shadowing bug.
ShinHyeongcheol
left a comment
There was a problem hiding this comment.
생각보다 많은 부분에서 빼먹었었네요...
수정 감사합니다!!
- RankingContract/ViewModel 내 `userInfo`를 `myRankInfo`로 변경 - Ranker 컴포저블의 `userProfileId` 파라미터를 `myProfileId`로 변경 - Ranker 내에서 본인 여부를 판단하는 비교 로직 오류 수정 (`userProfileId != userProfileId` -> `userProfileId != myProfileId`)
Related issue 🛠
Work Description ✏️
Screenshot 📸
N/A
Uncompleted Tasks 😅
To Reviewers 📢
거의 다 왔네요 고생하셨습니다 ~
Summary by CodeRabbit
릴리스 노트