[Fix] MenuType enum의 llegalArgumentException을 예방합니다#486
Conversation
…oseActivity to prevent crashes
Summary of ChangesHello, 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
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
안녕하세요. IllegalArgumentException 발생으로 인한 비정상 종료를 방지하기 위한 수고에 감사드립니다. lateinit 대신 nullable 타입과 runCatching을 사용하여 안전하게 MenuType을 파싱하도록 변경한 점이 좋습니다.
리뷰에서 몇 가지 중요한 점을 발견했습니다. 가장 치명적인 문제는 getIntents()가 setContent 이후에 호출되어, menuType 등의 속성이 초기화되기 전에 사용된다는 점입니다. 이로 인해 액티비티가 항상 즉시 종료될 것입니다. 또한, 오류 발생 시 사용자 경험을 개선할 수 있는 방안에 대한 제안도 포함했습니다.
자세한 내용은 각 코드 라인에 남긴 코멘트를 확인해주세요.
app/src/main/java/com/eatssu/android/presentation/cafeteria/review/ReviewComposeActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/eatssu/android/presentation/cafeteria/review/ReviewComposeActivity.kt
Outdated
Show resolved
Hide resolved
…r MenuType parsing failure
…Type during initial Compose rendering
| @@ -60,7 +66,6 @@ class ReviewComposeActivity : ComponentActivity() { | |||
There was a problem hiding this comment.
val menuTypeEnum = MenuType.entries.find { it.name == menuType }
menuTypeEnum?.let {
ReviewNav(
navHostController = navHostController,
menuType = MenuType.valueOf(menuType),
menuName = itemName,
id = itemId,
onExit = { finish() }
)
} ?: ErrorScreen(
onBackClick = { finish() }
)
이렇게 깔끔하게 수정하는건 어떨까욧? 굳이 에러 로깅을 할 필요는 없이 프론트엔드에서 느슨하게 처리해도 좋다고 생각합니당
Summary
MenuType이 이전 화면에서 intent로 넘어오는데 정체모를원인으로 no enum으로 넘어오는듯함
매번 그런게 아니라 어쩌다 한번으로 추정됨
Describe your changes
Issue
To reviewers
에러뷰 처리가 적절한지 확인해주세요!