Skip to content

Conversation

@HI-JIN2
Copy link
Member

@HI-JIN2 HI-JIN2 commented Nov 25, 2025

Summary

스크린샷 2025-11-25 오후 3 20 51
  • 아직 수정되지 않은 GaiException에 대한 처리를 했습니다
  • 참고로 크래시리틱스는 단순 Exception이 아닌, Exception이 제대로 처리되지 않아 강제종료가 발생하는 상황을 기록합니다

크래시는 3.1.3 이후로 발생하지 않습니다만, 네트워크 없을 때 앱이 종료되도록 설계된 흐름이 어색한 것 같아 dialog만 띄우도록 수정했습니다.

개요

문제 상황

네트워크 연결 끊김 > ServerErrorActivity로 이동하고 이전 화면을 finish함(=백스택 없음) > 다이알로그의 확인을 누르는 순간 뒤에 남아있는 액티비티가 없음으로 앱이 종료됨 (사용자는 앱이 갑자기 죽었다고 느낄 수 있음)

해결 방안

  • observeNetworkError 함수 내부를 ServerErrorActivity로의 이동이 아닌 다이알로그만 띄우도록 해서 액티비티를 이동시키지 않고 기존 액티비티로 유지하여 흐름을 지킴
  • 결과적으로 exception은 발생하나(어쩔수 없음 요청이 fail이니까) 앱이 터지지 않고, 그러므로 크래시로 기록되지 않음

추가작업사항

  • 식단 화면과 같이 api 요청이 여러개 있는 경우는 그에 따른 에러도 여러개이기 때문에 dialog 중복 생성 -> flag를 두어서 dialog가 한 번만 뜨도록 수정 4d7cdb7

Describe your changes

Screen_recording_20251125_153323.webm Screen_recording_20251125_153159.webm

Issue

To reviewers

  • 다이알로그 새로 디자인한걸로 변경하면 조을 것 같아용 [Feat] 새 Toast, Dialog 적용 #409 에서 해줄 수 있을까용?
  • 네트워크가 연결안되었다가 다시 연결되었을시 다시 api 호출하도록 하면 좋지 않을까요? (특히 splash에서는 좋을듯)

@HI-JIN2 HI-JIN2 changed the title [Fix] ㅎ don't move ServerErrorActivity, replace floating with dialog [Fix] GaiException 처리 Nov 25, 2025
@HI-JIN2 HI-JIN2 self-assigned this Nov 25, 2025
@HI-JIN2 HI-JIN2 marked this pull request as ready for review November 25, 2025 06:38
@HI-JIN2 HI-JIN2 changed the title [Fix] GaiException 처리 [Fix] 네트워크 없을 때 앱이 종료되도록 설계된 것을 dialog만 띄우도록 수정 Nov 25, 2025
Copy link
Member

@kangyuri1114 kangyuri1114 left a comment

Choose a reason for hiding this comment

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

슬랙도 확인했구용
기획 부분 반영 후 바로 머지하면 될 것 같습니다!

Comment on lines +32 to +48
val title = errorTitle ?: getString(R.string.server_error_title)
val message = errorMessage ?: getString(R.string.server_error_message)

networkErrorDialog = AlertDialog.Builder(this@observeNetworkError)
.setTitle(title)
.setMessage(message)
.setPositiveButton(getString(R.string.confirm)) { dialog, _ ->
dialog.dismiss()
}
.setCancelable(true)
.create()
.also { dialog ->
dialog.setOnDismissListener {
networkErrorDialog = null
}
dialog.show()
}
Copy link
Member

Choose a reason for hiding this comment

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

이부분이 슬랙에서 의견주신 다이얼로그 -> 토스트, 사용 문구 변경 맞죵? 요 부분만 반영되면 될 것 같네요!

그리고 추가적으로 해당 PR은 모두 문제 없는 것 같은데
브랜치 이동해서 observeNetworkError 확장함수 호출부를 봤는데요

사진처럼 각각 observeEvent(), observeTokenExpiration()함수 내부에 있는게 제가 보기엔 조금 부자연스러워보여서요!
혹시 해당 함수 호출부 액티비티 두곳 모두에서 onCreate()함수 내부에서 바로 호출해서 뎁스를 줄이는 거는 어떻게 생각하시나용?

Image Image

Copy link
Member

@PeraSite PeraSite left a comment

Choose a reason for hiding this comment

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

유리님께서 말씀해주신 부분은 사실 제가 작업한거지만... 수정되면 바로 머지해도 좋겠습니다!

다이알로그 새로 디자인한걸로 변경하면 조을 것 같아용 #409 에서 해줄 수 있을까용?

이 부분도 확인해서 함께 진행하겠습니다!

@HI-JIN2
Copy link
Member Author

HI-JIN2 commented Nov 30, 2025

@kangyuri1114 @PeraSite 말씀해주신 부분 반영했습니다! 3c5569f

@HI-JIN2 HI-JIN2 merged commit 02f6fb5 into develop Nov 30, 2025
1 check passed
@HI-JIN2 HI-JIN2 deleted the fix/gai-exception branch November 30, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GaiException 오류 해결

4 participants