-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor/#83] 자동 로그인 로직 변경 #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- ONBOARDING, WITHDRAWN, UNKNOWN 추가
- hasTokenUsecase 제거 - 리프레시 토큰을 기반으로 자동 로그인 시도
- UserRole에 따라 약관 동의, 온보딩, 홈 화면으로 이동
- TokenAuthenticator에서 AUTO_LOGIN_HEADER가 있는 경우 인증을 건너뛰도록 수정
Walkthrough자동 로그인 로직이 기존의 토큰 존재 여부 확인 방식에서 리프레시 토큰 기반의 자동 로그인 방식으로 전면 교체되었습니다. Splash 화면의 상태와 네비게이션 흐름이 사용자 역할(UserRole)에 따라 분기되도록 변경되었으며, 관련 데이터 소스, 리포지토리, 유즈케이스, ViewModel, UI, 네트워크 계층이 모두 이에 맞게 수정·확장되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SplashScreen
participant SplashViewModel
participant AutoLoginUseCase
participant AuthRepository
participant AuthLocalDataSource
participant AuthRemoteDataSource
User->>SplashScreen: 앱 실행
SplashScreen->>SplashViewModel: onCreate/init
SplashViewModel->>AutoLoginUseCase: invoke()
AutoLoginUseCase->>AuthRepository: getRefreshToken()
AuthRepository->>AuthLocalDataSource: getRefreshToken()
AuthLocalDataSource-->>AuthRepository: refreshToken
AuthRepository-->>AutoLoginUseCase: refreshToken
AutoLoginUseCase->>AuthRepository: reissueToken(refreshToken)
AuthRepository->>AuthRemoteDataSource: reissueToken(refreshToken)
AuthRemoteDataSource-->>AuthRepository: Result<AuthSession>
AuthRepository-->>AutoLoginUseCase: Result<AuthSession>
alt 성공
AutoLoginUseCase->>AuthRepository: updateAuthToken()
AutoLoginUseCase-->>SplashViewModel: UserRole 반환
else 실패
AutoLoginUseCase->>AuthRepository: clearAuthToken()
AutoLoginUseCase-->>SplashViewModel: UserRole.UNKNOWN 반환
end
SplashViewModel->>SplashScreen: 상태 업데이트 및 역할별 네비게이션
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20분 Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 변경사항 내에서는 요구사항과 무관한 기능적 코드 변경이 발견되지 않았습니다.) Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (14)
data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthRemoteDataSource.kt (1)
12-12
: reissueToken 도입 👍 — 공백 토큰 호출 가드/계약 문서화 제안시그니처는 목적에 부합합니다. 다만 refreshToken이 빈 문자열인 경우까지 네트워크 호출이 가지 않도록 계약을 명확히 해 주세요(상위 레이어에서 호출 금지 또는 Impl에서 가드). KDoc에 “blank면 실패 반환” 같은 정책을 남기면 유지보수에 도움이 됩니다.
data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthLocalDataSource.kt (1)
4-4
: null/blank 정책을 명시해 호출부 혼선을 줄이세요getRefreshToken이 null을 반환할 수 있으니 “빈 문자열은 반환하지 않고 null만 반환한다” 같은 규칙을 KDoc로 명시하면 호출부에서의 분기 단순화에 도움이 됩니다. 가능하면 저장 시점에 trim/검증해 항상 null 또는 유효 토큰만 나오도록 하는 것도 좋습니다.
data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt (2)
31-35
: 보안: 로깅 인터셉터에서 Refresh-Token 헤더 마스킹 권장해당 API는 민감한 Refresh-Token을 헤더로 전송합니다. OkHttp 로깅(또는 자체 네트워크 로깅)을 사용 중이라면 반드시 헤더 레닥션을 적용해 토큰이 로그/크래시리포트에 남지 않게 하세요.
예시:
val logging = HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY redactHeader("Authorization") redactHeader("Refresh-Token") } val client = OkHttpClient.Builder() .addInterceptor(logging) .build()
31-35
: 헤더 문자열 상수화(옵션)헤더 키/값(특히 "Refresh-Token", "Auto-Login", "No-Service-Token")을 상수로 중앙집중 관리하면 오타/일관성 이슈를 줄일 수 있습니다. Retrofit @headers에는 “No-Service-Token: true” 같은 전체 문자열 상수를 사용해야 합니다.
예시:
// 공용 상수 object HttpHeaders { const val NO_SERVICE_TOKEN_TRUE = "No-Service-Token: true" const val AUTO_LOGIN_TRUE = "Auto-Login: true" const val REFRESH_TOKEN = "Refresh-Token" } // 사용 @Headers(HttpHeaders.NO_SERVICE_TOKEN_TRUE, HttpHeaders.AUTO_LOGIN_TRUE) suspend fun postReissueToken( @Header(HttpHeaders.REFRESH_TOKEN) refreshToken: String, ): BaseResponse<LoginResponseDto>presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashSideEffect.kt (1)
8-9
: 내비게이션 사이드이펙트 추가 적절. 이름 일관성만 확인해주세요.Route/Screen 쪽에서
OnBoarding
(대문자 B)을 쓰고, 여기서는Onboarding
을 씁니다. 전역적으로 표기 일관성을 맞추는 것을 권장합니다.app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (1)
41-50
: 중복 내비게이션 방지 옵션 추가 제안(launchSingleTop).스플래시 진입 시 자동 로그인 결과에 따라 빠르게 연속 트리거될 가능성을 방지하려면
launchSingleTop = true
를 함께 지정하는 것을 권장합니다. 기존 popUpTo는 백스택 정리에 도움을 주지만 중복 네비게이션 자체를 차단하지는 않습니다.아래와 같이 수정 제안드립니다.
- navigator.navController.navigate(Route.TermsAgreement) { - popUpTo<Route.Splash> { inclusive = true } - } + navigator.navController.navigate(Route.TermsAgreement) { + launchSingleTop = true + popUpTo<Route.Splash> { inclusive = true } + } - navigator.navController.navigate(Route.OnBoarding()) { - popUpTo<Route.Splash> { inclusive = true } - } + navigator.navController.navigate(Route.OnBoarding()) { + launchSingleTop = true + popUpTo<Route.Splash> { inclusive = true } + }presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashState.kt (1)
9-10
: userRole의 널 제거 권장(UNKNOWN 기본값 사용).이미 도메인에
UNKNOWN
이 도입되었으므로 상태에서UserRole?
대신UserRole = UserRole.UNKNOWN
로 두면 널 처리 분기를 줄여 가독성과 안정성이 좋아집니다.- val userRole: UserRole? = null, + val userRole: UserRole = UserRole.UNKNOWN,presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashIntent.kt (2)
7-7
: 의도 명확성 OK. 널 대신 UNKNOWN 활용 고려.
SetUserRole(UserRole?)
대신UserRole = UNKNOWN
를 사용하면 뷰모델/리듀서의 분기 단순화에 유리합니다.SplashState
변경과 같이 적용하면 일관성이 높아집니다.
10-11
: 이름 표기 일관성 제안(OnBoarding vs Onboarding).Route/Screen에서
OnBoarding
표기를 사용 중이라면 Intent도NavigateToOnBoarding
로 맞추는 것을 권장합니다. 전역 네이밍 일관성은 추적과 검색에 도움이 됩니다.core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt (1)
22-22
: 헤더 “존재 여부” 대신 “값 확인”으로 오탐 방지 제안현재는 헤더 존재만으로 재인증을 우회합니다. 향후 다른 요청에서 동일 키를 잘못 넣을 경우 의도치 않게 재인증이 스킵될 수 있습니다.
"true"
값일 때만 우회하도록 완화하는 것을 권장합니다.가능한 최소 변경(diff):
- if (response.request.header(AUTO_LOGIN_HEADER) != null) return null + if (response.request.header(AUTO_LOGIN_HEADER)?.equals("true", ignoreCase = true) == true) { + return null + }또한(선택) 헤더 누락 대비 이중 안전장치로, 재발급 API 경로/태그 기반 예외를 추가하는 것도 고려해볼 수 있습니다.
domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/AutoLoginUseCase.kt (1)
15-23
: 토큰 저장/정리 결과 무시됨 → 원자성/에러 처리 강화 제안
updateAuthToken(...)
과clearAuthToken()
이Result<Unit>
를 반환하는데, 현재 결과를 무시합니다. 원격 재발급 성공 후 로컬 저장 실패 시 불일치가 생길 수 있으므로 최소한 실패 로깅/대응을 권장합니다.- 더 나아가 “재발급 + 로컬 저장”을 레포지토리 단에서 원자적으로 처리하도록 합치는 설계를 검토해보세요(예:
AuthRepository.reissueAndPersist(): Result<UserRole>
). 도메인단에서 부수효과를 분리하는 현재 방식도 가능하지만, 일관성과 오류 복구 관점에서 레포지토리 내 원자화가 안전합니다.예시(경미한 보강):
.onSuccess { authSession -> - authRepository.updateAuthToken( + authRepository.updateAuthToken( accessToken = authSession.accessToken, refreshToken = authSession.refreshToken, - ) + ).onFailure { /* TODO: 로깅 또는 재시도/폴백 정책 */ } } .onFailure { - authRepository.clearAuthToken() + authRepository.clearAuthToken().onFailure { /* TODO: 로깅 */ } }domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt (1)
12-15
: 리프레시 토큰 인자 노출 축소 제안
reissueToken(refreshToken: String)
대신reissueToken()
로 RT 취득을 레포지토리 내부로 숨기면 도메인 계층에서 민감 토큰을 다루지 않아도 되어 응집도와 보안성이 올라갑니다. 선택사항이나, 장기적으로 유지보수성이 좋아집니다.data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt (1)
38-48
: 재발급 성공 시 로컬 저장까지 레포지토리에서 일괄 처리 옵션
- 현재는 도메인 유즈케이스에서 저장을 호출합니다. 불일치(원격 성공, 로컬 실패) 가능성을 줄이려면 레포지토리의
reissueToken
내에서 로컬 저장까지 처리하고, 그 결과를 단일Result
로 반환하는 방식도 고려해볼 만합니다. 선택사항입니다.presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (1)
35-39
: Intent 명명 컨벤션과 정합성 개선 제안SetUserRole이 상태 업데이트 자체를 표현하는 명명입니다. 팀 MVI 컨벤션(서버 응답 성공 결과를 나타내는 Intent: 예, LoadXxxSuccess)에 맞추려면 AutoLoginCompleted 또는 ResolveUserRoleSuccess 같은 이름을 고려해볼 만합니다. 동작은 문제 없습니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt
(1 hunks)core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStore.kt
(0 hunks)core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt
(0 hunks)core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt
(3 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthLocalDataSource.kt
(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthRemoteDataSource.kt
(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthLocalDataSourceImpl.kt
(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt
(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt
(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt
(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/auth/model/UserRole.kt
(2 hunks)domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt
(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/AutoLoginUseCase.kt
(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/HasTokenUseCase.kt
(0 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashScreen.kt
(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
(3 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashIntent.kt
(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashSideEffect.kt
(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashState.kt
(1 hunks)
💤 Files with no reviewable changes (3)
- core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStore.kt
- domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/HasTokenUseCase.kt
- core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-07-23T13:32:26.263Z
Learnt from: l5x5l
PR: YAPP-Github/Bitnagil-Android#41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageIntent.kt:6-6
Timestamp: 2025-07-23T13:32:26.263Z
Learning: In the Bitnagil Android project's MVI architecture, Intent classes like `LoadMyPageSuccess` are named to represent successful API response results that carry loaded data, not just user actions. This naming convention is used for future API integration where the intent will be triggered when my page data loading succeeds from the server.
Applied to files:
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashSideEffect.kt
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashIntent.kt
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
📚 Learning: 2025-07-11T03:54:23.348Z
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.348Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
Applied to files:
data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthLocalDataSource.kt
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthLocalDataSourceImpl.kt
📚 Learning: 2025-07-06T04:26:03.870Z
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#19
File: core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt:16-20
Timestamp: 2025-07-06T04:26:03.870Z
Learning: TokenAuthenticator 클래스는 현재 임시 코드로 구현되어 있으며, 실제 토큰 재발급 API 연동 시점에 올바른 구현으로 수정될 예정입니다.
Applied to files:
core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt
data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt
📚 Learning: 2025-07-03T09:05:30.067Z
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#16
File: core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt:12-46
Timestamp: 2025-07-03T09:05:30.067Z
Learning: 이 프로젝트에서는 네트워크 모듈을 점진적으로 개발하고 있으며, TokenAuthenticator 같은 인증 관련 기능은 실제 API 연동 작업 시점에 NetworkModule에 연결할 예정입니다.
Applied to files:
core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt
📚 Learning: 2025-07-23T13:31:46.809Z
Learnt from: l5x5l
PR: YAPP-Github/Bitnagil-Android#41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageState.kt:6-14
Timestamp: 2025-07-23T13:31:46.809Z
Learning: In the Bitnagil Android project, MviState interface extends Parcelable, so any class implementing MviState automatically implements Parcelable. Therefore, Parcelize annotation works correctly without explicitly adding Parcelable implementation.
Applied to files:
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashState.kt
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
🧬 Code Graph Analysis (2)
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt (1)
data/src/main/java/com/threegap/bitnagil/data/common/SafeApiCall.kt (1)
safeApiCall
(10-25)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (1)
presentation/src/main/java/com/threegap/bitnagil/presentation/common/mviviewmodel/MviViewModel.kt (2)
sendSideEffect
(23-23)sendIntent
(30-37)
🔇 Additional comments (11)
domain/src/main/java/com/threegap/bitnagil/domain/auth/model/UserRole.kt (1)
6-8
: UserRole 기반 when 분기 없음 — 분기 누락 우려 없음위 스크립트 실행 결과
UserRole
을 조건으로 하는when
분기문이 전혀 발견되지 않았습니다.
따라서 ONBOARDING, WITHDRAWN, UNKNOWN 추가로 인한 분기 누락 이슈는 없습니다. 안심하고 머지하세요.data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthLocalDataSource.kt (1)
4-4
: hasToken 사용 잔여 확인 완료
rg
검색 결과 저장소 전반에hasToken(
호출이 전혀 남아있지 않음을 확인했습니다. 관련 수정 누락에 따른 런타임 오류 우려는 없습니다.data/src/main/java/com/threegap/bitnagil/data/auth/service/AuthService.kt (1)
31-35
: 엔드포인트/헤더 구성 적절합니다Auto-Login 헤더로 Authenticator 루프를 회피하고, No-Service-Token으로 불필요한 토큰 주입을 막는 설정이 명확합니다. 서버 계약과 일치한다면 이 구성이 가장 깔끔합니다.
core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt (1)
22-22
: Auto-Login 헤더 기반 루프 방지 의도 적합 — 재시도에서 헤더 제거까지 LGTM
- Auto-Login 헤더가 있는 요청은 재인증을 시도하지 않고(null 반환), 재발급 후 재시도 요청에서는 해당 헤더를 제거하는 흐름이 잘 맞습니다. 토큰 재발급 API 자체에서의 무한 재시도/순환을 막는 데에 효과적입니다.
Also applies to: 86-86, 101-102
domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/AutoLoginUseCase.kt (1)
10-27
: 리프레시 토큰 기반 자동 로그인 플로우 정합성 좋습니다
- RT 없을 때 UNKNOWN 즉시 반환, 성공 시 토큰 갱신/저장, 실패 시 정리까지 도메인 흐름이 간결하고 명확합니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashScreen.kt (1)
32-33
: 새 네비게이션 경로(약관 동의/온보딩) 연결 LGTM
- 콜백 파라미터 추가 및
collectSideEffect
분기 확장은 스플래시 내 라우팅 개편 의도와 일치합니다. 호출부(MainNavHost) 업데이트만 지속적으로 일관성 체크하면 되겠습니다.Also applies to: 40-41
domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt (1)
12-15
: 토큰 라이프사이클 API 도입 방향성 OK
reissueToken/getRefreshToken/updateAuthToken/clearAuthToken
로 역할이 명시화되어 도메인 유즈케이스 작성이 수월해졌습니다.data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt (1)
38-48
: 신규 메서드 구현 일관성 OK
- 원격
reissueToken
매핑, 로컬 RT 조회/업데이트/정리 위임이 인터페이스와 정합합니다.presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (3)
19-21
: AutoLoginUseCase 의존성 주입으로의 전환 적절자동 로그인 로직의 단일 진입점으로 UseCase를 갖는 DI 구성은 책임 분리에 부합합니다.
27-27
: 초기 진입 시 오토로그인 1회 트리거 적절Splash 진입 시 비동기 실행으로 UI 블로킹 없이 처리되는 점 좋습니다.
52-60
: 새 내비게이션 사이드 이펙트 추가 LGTM약관 동의/온보딩 분기 추가가 요구사항과 일치합니다.
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthLocalDataSourceImpl.kt
Outdated
Show resolved
Hide resolved
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthRemoteDataSourceImpl.kt
Show resolved
Hide resolved
domain/src/main/java/com/threegap/bitnagil/domain/auth/model/UserRole.kt
Show resolved
Hide resolved
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
Show resolved
Hide resolved
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
Show resolved
Hide resolved
core/network/src/main/java/com/threegap/bitnagil/network/auth/TokenAuthenticator.kt
Show resolved
Hide resolved
domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/AutoLoginUseCase.kt
Show resolved
Hide resolved
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashState.kt
Show resolved
Hide resolved
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
Show resolved
Hide resolved
- 자동로그인 요청에 5초 timeout 설정 - 자동로그인 실패시 UserRole을 null로 설정
There was a problem hiding this 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
♻️ Duplicate comments (2)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (2)
78-85
: 재귀 delay 패턴 유지 – 이전 리뷰와 동일한 지적 사항
onAnimationCompleted()
가isAutoLoginCompleted
가false
일 때마다
새 코루틴을 생성하며 자기 자신을 다시 호출합니다.
무한 대기 시 코루틴이 계속 쌓일 수 있다는 위험은 여전히 존재합니다.
※ 지난 리뷰에서 동일한 개선안을 제안드렸으므로 자세한 내용은
과거 코멘트를 참고해 주세요.
87-91
: UserRole 분기에서 UNKNOWN·WITHDRAWN 명시 필요
else
로 뭉뚱그리지 말고UserRole.UNKNOWN
,UserRole.WITHDRAWN
,null
을 명시적으로 다루라는 지난 리뷰의 권고가 반영되지 않았습니다.
역할이 추가될 때 누락을 방지하려면 명시 분기가 안전합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-23T13:32:26.263Z
Learnt from: l5x5l
PR: YAPP-Github/Bitnagil-Android#41
File: presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/model/MyPageIntent.kt:6-6
Timestamp: 2025-07-23T13:32:26.263Z
Learning: In the Bitnagil Android project's MVI architecture, Intent classes like `LoadMyPageSuccess` are named to represent successful API response results that carry loaded data, not just user actions. This naming convention is used for future API integration where the intent will be triggered when my page data loading succeeds from the server.
Applied to files:
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
🧬 Code Graph Analysis (1)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (1)
presentation/src/main/java/com/threegap/bitnagil/presentation/common/mviviewmodel/MviViewModel.kt (2)
sendSideEffect
(23-23)sendIntent
(30-37)
🪛 detekt (1.23.8)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
[warning] 71-71: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다!
[ PR Content ]
자동 로그인 로직을 변경했습니다.
Related issue
Screenshot 📸
Work Description
To Reviewers 📢
Summary by CodeRabbit
신규 기능
개선 및 변경
버그 수정