Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun handleException(
exception = exception,
action = {
onLoginRequired()
}
},
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class LoginPresenter @AssistedInject constructor(
when (event) {
is LoginUiEvent.OnKakaoLoginButtonClick -> {
isLoading = true
sideEffect = LoginSideEffect.KakaoLogin
sideEffect = LoginSideEffect.KakaoLogin()
}

is LoginUiEvent.LoginFailure -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data class LoginUiState(

@Immutable
sealed interface LoginSideEffect {
data object KakaoLogin : LoginSideEffect
data class KakaoLogin(private val key: String = UUID.randomUUID().toString()) : LoginSideEffect
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@easyhooon 로그인 API 에러 처리 방식을 개선하면서 LoginSideEffect를 초기화해주는 로직이 필요해졌습니다. (안그러면 카카오 로그인 재시도 시 무한로딩 발생) 토스트메세지 이벤트처럼 UUID 값을 사용하는 방식으로 변경했는데 확인 부탁드립니다

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

아 무한로딩 발생하는게 이거 때문이었군여
분명 타임아웃 시간이 지나서 로딩이 끝날때가 되었는데 계속 돌길래 뭔가했는데

Copy link
Copy Markdown
Contributor Author

@easyhooon easyhooon Oct 21, 2025

Choose a reason for hiding this comment

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

        fun handleEvent(event: LoginUiEvent) {
            when (event) {
                is LoginUiEvent.OnKakaoLoginButtonClick -> {
                    isLoading = true
                    sideEffect = LoginSideEffect.KakaoLogin()
                }
  1. 사용자가 카카오 로그인 버튼 클릭
  2. sideEffect = LoginSideEffect.KakaoLogin() → RememberedEffect 실행
  3. 카카오 로그인 실패 → eventSink(LoginUiEvent.LoginFailure(...))
  4. sideEffect = LoginSideEffect.ShowToast(...) → RememberedEffect 실행 (Toast 표시)
  5. 사용자가 다시 카카오 로그인 버튼 클릭
  6. sideEffect = LoginSideEffect.KakaoLogin()
    -> 문제:프로퍼티가 없는 LoginSideEffect.KakaoLogin()은 구조적으로 동일한 값으로 인식됨
  7. Compose가 state.sideEffect가 변경되지 않았다고 판단
  8. RememberedEffect가 재실행되지 않음
  9. 카카오 로그인이 다시 시작되지 않음
  10. isLoading = true만 남아 무한 로딩

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

uuid 방식으로 해결할 수 있는 케이스라 괜찮은거같습니다!

data class ShowToast(
val message: String,
private val key: String = UUID.randomUUID().toString(),
Expand Down
Loading