Skip to content

[FIX/#129] 챌린지 종료시 챌린지 시작 화면 이동#130

Merged
nhyeonii merged 2 commits intodevelopfrom
fix/#129-challenge-navigation
Jan 21, 2026
Merged

[FIX/#129] 챌린지 종료시 챌린지 시작 화면 이동#130
nhyeonii merged 2 commits intodevelopfrom
fix/#129-challenge-navigation

Conversation

@nhyeonii
Copy link
Copy Markdown
Contributor

@nhyeonii nhyeonii commented Jan 21, 2026

Related issue 🛠

Work Description ✏️

  • 챌린지 종료시 챌린지 시작 화면 이동

Screenshot 📸

Uncompleted Tasks 😅

  • Task1

To Reviewers 📢

급하게 해결한 거라 qa 끝나고 로직 수정해야할 것 같아요 cc. @hyeminililo

Summary by CodeRabbit

  • 버그 수정
    • 도전 과제 진행 처리 중 HTTP 404 오류 발생 시 사용자가 도전 시작 페이지로 자동 이동하도록 수정되었습니다. 이전에는 해당 오류가 무시되었으나, 이제 404에 한해 적절히 리디렉션됩니다. 성공 및 로딩 관련 동작에는 변경이 없습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@nhyeonii nhyeonii requested a review from a team as a code owner January 21, 2026 13:31
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 21, 2026

Walkthrough

ChallengeMissionProgressViewModel의 postChallengeAdvanceDay 실패 핸들러가 수정되어, 이제 HttpException 중 HTTP 404 응답을 감지하면 NavigateToChallengeStart 사이드 이펙트를 발행합니다. 다른 성공 및 로딩 경로는 변경되지 않았습니다.

Changes

Cohort / File(s) Summary
ViewModel 오류 처리
app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt
postChallengeAdvanceDay 실패 핸들러에 HttpException의 HTTP 404 코드를 검사하여 NavigateToChallengeStart 사이드 이펙트 발행 로직 추가 (기존 실패 무시 동작 변경)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • usuuhyn
🚥 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 제목은 챌린지 종료시 챌린지 시작 화면 이동에 관한 것으로, 실제 변경사항인 postChallengeAdvanceDay의 404 에러 처리와 정확히 일치합니다.
Description check ✅ Passed PR 설명이 템플릿 구조(Related issue, Work Description, Screenshot, Uncompleted Tasks, To Reviewers)를 모두 포함하고 있으며, 필수 정보가 충분히 기재되어 있습니다.
Linked Issues check ✅ Passed 이슈 #129는 챌린지 7일 후 시작 화면으로 이동하는 버그를 요구하며, PR의 변경사항(404 에러시 NavigateToChallengeStart 발생)이 이 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed ChallengeMissionProgressViewModel의 postChallengeAdvanceDay 실패 처리 추가는 이슈 #129의 범위 내 변경이며, 범위를 벗어난 변경사항이 없습니다.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt`:
- Around line 122-126: The MutableSharedFlow used for side effects (_sideEffect
/ MutableSharedFlow<ChallengeMissionProgressSideEffect>) is created with the
default 0 buffer which risks dropping events during brief absence of collectors;
update its initialization to add extraBufferCapacity (e.g., extraBufferCapacity
= 1 or 2) while keeping emit() calls (do not switch to tryEmit()), so emits like
_sideEffect.emit(ChallengeMissionProgressSideEffect.NavigateToChallengeStart)
will be buffered safely even across short lifecycle/Compose recompositions.

Comment on lines +122 to +126
.onLogFailure { e ->
if (e is retrofit2.HttpException && e.code() == 404) {
_sideEffect.emit(ChallengeMissionProgressSideEffect.NavigateToChallengeStart)
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt | head -150

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 5947


🏁 Script executed:

cd app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress && find . -type f -name "*.kt" | grep -i screen | head -5

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 109


🏁 Script executed:

find app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress -type f -name "*Screen*.kt" -o -name "*UI*.kt" -o -name "*Composable*.kt"

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 185


🏁 Script executed:

rg "ChallengeMissionProgressSideEffect|ChallengeMissionProgressViewModel" app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress --type kt -l

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 100


🏁 Script executed:

cat app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressScreen.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 7676


🏁 Script executed:

rg "fun.*collectLatestSideEffect" --type kt -A 5

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 100


🏁 Script executed:

rg "fun.*collectLatestSideEffect" -A 5

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 691


🏁 Script executed:

cat app/src/main/java/com/cherrish/android/core/common/extension/FlowExt.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 1032


SideEffect 이벤트 손실 방지를 위해 버퍼 용량 추가 권장

현재 MutableSharedFlow 기본 버퍼가 0으로 설정되어 있습니다. UI 레이어가 collectLatestSideEffect로 적극적으로 수집하는 구조이므로 일반적인 상황에서 emit()이 블로킹되지는 않으나, Compose 재구성이나 라이프사이클 전환 중 수집자가 일시적으로 없을 수 있습니다. 안정성을 위해 extraBufferCapacity를 추가하는 것이 좋습니다.

주의: tryEmit()은 버퍼가 가득 차면 false를 반환하고 이벤트를 드롭하므로 탐색 이벤트 손실로 이어질 수 있습니다. emit() 유지하고 버퍼만 확대하는 것을 권장합니다.

🛠️ 개선 제안
-    private val _sideEffect = MutableSharedFlow<ChallengeMissionProgressSideEffect>()
+    private val _sideEffect = MutableSharedFlow<ChallengeMissionProgressSideEffect>(
+        extraBufferCapacity = 1
+    )
🤖 Prompt for AI Agents
In
`@app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt`
around lines 122 - 126, The MutableSharedFlow used for side effects (_sideEffect
/ MutableSharedFlow<ChallengeMissionProgressSideEffect>) is created with the
default 0 buffer which risks dropping events during brief absence of collectors;
update its initialization to add extraBufferCapacity (e.g., extraBufferCapacity
= 1 or 2) while keeping emit() calls (do not switch to tryEmit()), so emits like
_sideEffect.emit(ChallengeMissionProgressSideEffect.NavigateToChallengeStart)
will be buffered safely even across short lifecycle/Compose recompositions.

@nhyeonii nhyeonii merged commit 27bd695 into develop Jan 21, 2026
3 checks passed
@hyeminililo hyeminililo added FIX🐛 오류 및 버그 수정 혜민🍒 혜민 담당 labels Jan 21, 2026
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] 챌린지 시술 7일 후 챌린지 시작 화면으로 이동

2 participants