You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: TopicScreen crashes when TopicUiState.Error is emitted (TODO() in production) #2108
Is there a StackOverflow question about this issue?
I have searched StackOverflow
What happened?
TopicScreen calls kotlin.TODO() for the TopicUiState.Error branch, which throws NotImplementedError at runtime and crashes the screen whenever the underlying topic flow surfaces an error.
TopicScreen then hits TopicUiState.Error -> TODO() (TopicScreen.kt:132) and crashes.
Any exception thrown by the Room flow (DB IO error, mapper failure, etc.) or any upstream operator therefore crashes the topic detail screen instead of showing an error UI.
The branch is also untested: TopicScreenTest only drives TopicUiState.Loading and TopicUiState.Success.
Relevant logcat output
```shell
FATAL EXCEPTION: main
kotlin.NotImplementedError: An operation is not implemented.
at com.google.samples.apps.nowinandroid.feature.topic.impl.TopicScreenKt.TopicScreen(TopicScreen.kt:132)
```
Activity
Handle TopicUiState.Error without crashing TopicScreen