-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] 탈퇴하기 리팩토링 #354
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
[Fix] 탈퇴하기 리팩토링 #354
Conversation
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.
Summary of Changes
Hello @HI-JIN2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
이 PR은 사용자 탈퇴 기능을 리팩토링하여 기능의 안정성과 사용자 경험을 향상시키는 데 중점을 둡니다. 탈퇴 프로세스를 간소화하고, 사용자가 탈퇴 완료 후 로그인 화면으로 정확하게 이동하며 명확한 피드백을 받을 수 있도록 개선하는 것이 주요 목표입니다.
Highlights
- 탈퇴 로직 간소화: 사용자 탈퇴(signOut) 로직의 반환 타입을
Flow<BaseResponse<Boolean>>에서Boolean으로 직접 변경하여 데이터 흐름을 단순화했습니다. - 사용자 경험 개선: 탈퇴 시 토스트 메시지가 두 번 뜨는 문제를 해결하고, 성공적으로 탈퇴하면 로그인 화면으로 이동하도록 하여 사용자 경험을 개선했습니다.
- UI 상태 관리 개선:
SignOutActivity에서UiState및UiEvent를 활용하여 UI 상태 관리 및 단발성 이벤트(토스트 메시지, 화면 전환) 처리를 명확하게 분리하고 개선했습니다. - SignOutState 간소화:
SignOutState데이터 클래스에서 불필요한 필드들을 제거하고,isSignOuted필드만 남겨 상태 정의를 간결하게 만들었습니다.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Summary of Changes
Hello @HI-JIN2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
이 PR은 사용자 탈퇴 기능의 전반적인 안정성과 사용자 경험을 향상시키기 위한 리팩토링을 포함합니다. 기존의 이중 토스트 메시지 및 로그인 화면 미전환 문제를 해결하고, 데이터 계층에서 UI 계층까지의 signOut 작업 흐름을 간소화하며, UiState 및 UiEvent 패턴을 도입하여 보다 견고하고 예측 가능한 UI 상태 관리를 구현했습니다. 이를 통해 사용자는 더욱 부드럽고 정확한 탈퇴 프로세스를 경험할 수 있습니다.
Highlights
- 탈퇴 기능 리팩토링: 탈퇴 기능의 사용자 경험을 개선하기 위해 리팩토링을 진행했습니다. 기존에 탈퇴 시 토스트 메시지가 두 번 뜨고 로그인 화면으로 이동하지 않던 문제를 해결하여, 이제는 한 번의 토스트 메시지 후 정상적으로 로그인 화면으로 이동합니다.
- 데이터 흐름 간소화: UserRepositoryImpl, UserRepository, SignOutUseCase 전반에 걸쳐 signOut 메서드의 반환 타입을
Flow<BaseResponse<Boolean>>에서Boolean으로 변경하여 데이터 흐름을 간소화했습니다. 이는 불필요한 Flow 래핑을 제거하고 직접적인 결과 처리를 가능하게 합니다. - UI 상태 관리 개선: SignOutViewModel에서
UiState와UiEvent패턴을 도입하여 UI 상태 관리 및 이벤트 처리를 명확하게 분리했습니다. 이를 통해 로딩, 성공, 에러 상태를 보다 체계적으로 관리하고, 토스트 메시지와 같은 UI 이벤트를 효율적으로 전달할 수 있게 되었습니다. - 닉네임 비교 로직 개선: SignOutActivity에서 닉네임 입력 시 비교 로직을
afterTextChanged로 이동하고,trim()및 null-safe 처리를 강화하여 사용자 입력의 유효성을 더욱 견고하게 확인하도록 개선했습니다.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
전반적으로 탈퇴 로직을 Flow에서 suspend 함수와 Boolean 반환 타입을 사용하도록 리팩토링하여 코드를 간소화한 점이 좋습니다. UiState와 UiEvent를 도입하여 상태 관리와 UI 이벤트를 분리한 것도 좋은 개선입니다. 몇 가지 추가적인 개선 사항을 제안합니다. SignOutViewModel에서 data class의 프로퍼티를 val로 변경하고, API 호출 시 발생할 수 있는 예외를 처리하는 로직을 추가하는 것을 권장합니다. 또한 SignOutActivity의 코드 가독성을 높이기 위한 몇 가지 리팩토링 제안도 포함했습니다. 리뷰어 요청 사항에 대해 답변드리자면, SignOutState는 현재처럼 isSignOuted만 갖도록 단순하게 유지하고, 로딩 및 오류 상태는 제네릭 UiState로 관리하는 현재 구조가 좋습니다.
app/src/main/java/com/eatssu/android/presentation/mypage/SignOutViewModel.kt
Show resolved
Hide resolved
app/src/main/java/com/eatssu/android/presentation/mypage/SignOutActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/eatssu/android/presentation/mypage/SignOutViewModel.kt
Outdated
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.
Code Review
탈퇴하기 기능 리팩토링을 잘 진행해주셨네요! Flow를 제거하고 Boolean을 직접 반환하도록 변경하여 코드가 훨씬 간결해졌습니다. 또한 MVI 패턴을 적용하여 UI 상태와 이벤트를 분리한 점도 좋습니다. 이로 인해 토스트 메시지가 여러 번 뜨던 버그와 화면 이동이 안되던 문제가 해결되었네요. 몇 가지 코드 개선 제안을 남겨드리니 확인해보시면 좋겠습니다.
app/src/main/java/com/eatssu/android/presentation/mypage/SignOutViewModel.kt
Show resolved
Hide resolved
app/src/main/java/com/eatssu/android/presentation/mypage/SignOutActivity.kt
Outdated
Show resolved
Hide resolved
| is UiState.Loading -> { | ||
| //로딩중 | ||
| } | ||
|
|
||
| is UiState.Success -> { | ||
| if (it.data?.isSignOuted == true) { | ||
| val intent = Intent(this@SignOutActivity, LoginActivity::class.java) | ||
| intent.flags = | ||
| Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK | ||
| startActivity(intent) | ||
| finish() | ||
| } | ||
| } | ||
|
|
||
| is UiState.Error -> { | ||
| //에러 | ||
| } | ||
| } |
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.
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.
공통적으로 uiState가 loading일때와 error일떄의 uiux를 통일하면 좋을 거 같아요..!
다른 부분들도 uistate를 적용하기 했지만 에러나 로딩 상태에 대해 큰 로직없이 비어있는 곳도 많은 듯 해서..!
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.
요건 따로 이야기해봅시답
app/src/main/java/com/eatssu/android/presentation/mypage/SignOutViewModel.kt
Outdated
Show resolved
Hide resolved
| override suspend fun signOut(): Boolean { | ||
| return userService.signOut().result ?: false | ||
| } |
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.
BaseResponse에 result가 T?라서 Boolean이 올 자리에 Boolean?이 와서 false로 기본값을 주었는데, 이렇게 해도 괜찮을까요?
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.
signOut에 대한 result도 단순 Boolean값이라 null로 올 것 같지는 않지만
null인 경우 false로 두는 거 괜찮을거같은데요?!
kangyuri1114
left a comment
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.
동작에는 충분히 무리없는 코드 같아 먼저 어푸릅 드립니다!
리뷰 한번 확인해주세용 🙇🏼♀️
| override suspend fun signOut(): Boolean { | ||
| return userService.signOut().result ?: false | ||
| } |
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.
signOut에 대한 result도 단순 Boolean값이라 null로 올 것 같지는 않지만
null인 경우 false로 두는 거 괜찮을거같은데요?!
| } | ||
| } catch (e: Exception) { | ||
| _uiState.value = UiState.Error | ||
| _uiEvent.emit(UiEvent.ShowToast("오류가 발생했습니다.")) |
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.
catch까지 오는 오류라면 상세 오류 원인을 UI단으로 보여주는 건 UX적으로 별로일까요?
사용자도 왜 오류가 났는지 명확하게 알면 좋을 거 같아서..!
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.
그럼 제보나 qa하기도 좋을 거 같구,,
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.
흠... 지금으로썬 마땅히 에러뷰가 없으니 토스트라도 띄워주는게 좋을 것 같네염 bf225d9 반영했습니다
Summary
탈퇴하기를 리팩토링합니다.
Describe your changes
Screen_recording_20250917_003935.webm
To reviewers
SignOutState를 어떻게 정의해야할지 모르겠어서 해당 부분 봐주시면 감사하겠습니다.