[MOD#1594] BuildConfig.DEBUG 여부에 따른 앱잼탬프/일반 솝탬프 분기 처리 및 API 호출 로직 수정#1595
Conversation
- SoptLogUrl 및 MySoptLogItemType에서 DEBUG 모드일 때만 "appjamtamp" URL을 사용하도록 변경 - SoptLogScreen 내 데이터 로딩 및 에러 재시도 로직에서 DEBUG 여부에 따라 getSoptLogInfoData와 getSoptLogInfo를 구분하여 호출하도록 수정
…into mod/#1594-hide-appjamtamp
Summary by CodeRabbit릴리스 노트
기능 요약SoptLog 기능이 BuildConfig.DEBUG 플래그에 따라 환경별로 다른 URL과 데이터 페칭 메서드를 사용하도록 변경되었습니다. 디버그 빌드에서는 "appjamtamp", 그 외에는 "soptamp"를 사용합니다. 변경 사항SoptLog 앱잼탬프 조건부 처리
예상 코드 리뷰 시간🎯 2 (단순) | ⏱️ ~10분 체리
🚥 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)
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.
🧹 Nitpick comments (2)
feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/model/MySoptLogItemType.kt (1)
41-41: ⚡ Quick win중복된 DEBUG/URL 분기 로직 — 단일 출처로 통합 권장.
이
if (BuildConfig.DEBUG) "appjamtamp" else "soptamp"식은SoptLogUrl.SOPTAMP(L33)와 완전히 동일합니다. 두 곳에 분산되어 있으면 TODO 제거(앱잼탬프 기간 종료 시) 시점에 한쪽만 수정되어 어긋날 위험이 있습니다.SoptLogUrl.SOPTAMP.url을 재사용해 단일 출처로 만드는 것을 권장합니다.♻️ 제안 변경
- COMPLETED_MISSION(title = "완료미션", category = SoptLogCategory.SOPTAMP, url = if (BuildConfig.DEBUG) "appjamtamp" else "soptamp", count = { it.soptampCount ?: 0 }), + COMPLETED_MISSION(title = "완료미션", category = SoptLogCategory.SOPTAMP, url = SoptLogUrl.SOPTAMP.url, count = { it.soptampCount ?: 0 }),통합 시
BuildConfigimport는 제거 가능하며,SoptLogUrlimport 추가가 필요합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/model/MySoptLogItemType.kt` at line 41, The COMPLETED_MISSION enum entry in MySoptLogItemType uses an inline if(BuildConfig.DEBUG) URL branch which duplicates logic in SoptLogUrl.SOPTAMP; replace the inline expression in COMPLETED_MISSION (in MySoptLogItemType) with a reference to SoptLogUrl.SOPTAMP.url to centralize the URL logic, and remove the now-unnecessary BuildConfig import while adding/importing SoptLogUrl if not already imported.feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/SoptLogScreen.kt (1)
73-79: ⚡ Quick winDEBUG 게이팅 분기 중복 제거 + 릴리즈 경로 테스트 커버 필요
SoptLogScreen.kt의
SoptLogRoute에서 BuildConfig.DEBUG에 따른 호출이 초기 로딩(라인 14-20)과 에러 재시도(NetworkErrorDialog onConfirm, 라인 49-54) 모두에서getSoptLogInfoData()vsgetSoptLogInfo()로 중복됩니다. 또한 두 메서드는 실제 동작이 달라서(getSoptLogInfoData()는getMyAppjamInfo()도 함께 호출하고isAppjamJoined를 갱신,getSoptLogInfo()는getSoptLogInfo()만 호출) 릴리즈에서만 보이는 경로가 디버그 빌드로는 검증되기 어렵습니다.♻️ 제안 변경
+ val fetchSoptLogInfo: () -> Unit = { + // Todo : 앱잼탬프 기간일 때 다시 열기 if Build.Debug 제거 + if (BuildConfig.DEBUG) viewModel.getSoptLogInfoData() else viewModel.getSoptLogInfo() + } + LaunchedEffect(Unit) { - if (BuildConfig.DEBUG) { // Todo : 앱잼탬프 기간일 때 다시 열기 if Build.Debug 제거 - viewModel.getSoptLogInfoData() - } else { - viewModel.getSoptLogInfo() - } + fetchSoptLogInfo() }
NetworkErrorDialog(onConfirm = ...)도 동일하게onConfirm = fetchSoptLogInfo로 통일하는 방향이 안전합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/SoptLogScreen.kt` around lines 73 - 79, There is duplicated BuildConfig.DEBUG branching calling getSoptLogInfoData() vs getSoptLogInfo() in multiple places; create a single helper function (e.g., fetchSoptLogInfo) inside the SoptLogRoute/SoptLogScreen composable that encapsulates the if (BuildConfig.DEBUG) -> viewModel.getSoptLogInfoData() else -> viewModel.getSoptLogInfo() logic, replace the LaunchedEffect call and NetworkErrorDialog(onConfirm = ...) to call fetchSoptLogInfo(), and ensure the helper invokes the release path so the getSoptLogInfo() behavior is exercisable in Release builds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/model/MySoptLogItemType.kt`:
- Line 41: The COMPLETED_MISSION enum entry in MySoptLogItemType uses an inline
if(BuildConfig.DEBUG) URL branch which duplicates logic in SoptLogUrl.SOPTAMP;
replace the inline expression in COMPLETED_MISSION (in MySoptLogItemType) with a
reference to SoptLogUrl.SOPTAMP.url to centralize the URL logic, and remove the
now-unnecessary BuildConfig import while adding/importing SoptLogUrl if not
already imported.
In
`@feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/SoptLogScreen.kt`:
- Around line 73-79: There is duplicated BuildConfig.DEBUG branching calling
getSoptLogInfoData() vs getSoptLogInfo() in multiple places; create a single
helper function (e.g., fetchSoptLogInfo) inside the SoptLogRoute/SoptLogScreen
composable that encapsulates the if (BuildConfig.DEBUG) ->
viewModel.getSoptLogInfoData() else -> viewModel.getSoptLogInfo() logic, replace
the LaunchedEffect call and NetworkErrorDialog(onConfirm = ...) to call
fetchSoptLogInfo(), and ensure the helper invokes the release path so the
getSoptLogInfo() behavior is exercisable in Release builds.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c304a8f4-35da-4f1d-a3c2-822265dae810
📒 Files selected for processing (3)
feature/soptlog/src/main/java/org/sopt/official/feature/soptlog/SoptLogScreen.ktfeature/soptlog/src/main/java/org/sopt/official/feature/soptlog/model/MySoptLogItemType.ktfeature/soptlog/src/main/java/org/sopt/official/feature/soptlog/navigation/SoptLogUrl.kt
Related issue 🛠
Work Description ✏️
To Reviewers 📢
급한 처리가 필요하여 부득이하게 해당 방법을 채택하였습니다
release, debug 모드에서 모두 빌드 확인은 하였으나 release 버전에서 솝탬프를 볼 수 없는 관계로 해당 내용까지 확인 완료하였습니다