Is there an existing issue for this?
Is there a StackOverflow question about this issue?
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.
Reachability:
TopicViewModel.topicUiState runs topicsRepository.getTopic(id).asResult().
core.common.result.Result.asResult catches any Throwable from upstream and emits Result.Error(it) (see core/common/.../result/Result.kt:32).
TopicViewModel maps Result.Error -> TopicUiState.Error (TopicViewModel.kt:131).
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)
```
Code of Conduct
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
TopicScreencallskotlin.TODO()for theTopicUiState.Errorbranch, which throwsNotImplementedErrorat runtime and crashes the screen whenever the underlying topic flow surfaces an error.Reachability:
TopicViewModel.topicUiStaterunstopicsRepository.getTopic(id).asResult().core.common.result.Result.asResultcatches anyThrowablefrom upstream and emitsResult.Error(it)(seecore/common/.../result/Result.kt:32).TopicViewModelmapsResult.Error -> TopicUiState.Error(TopicViewModel.kt:131).TopicScreenthen hitsTopicUiState.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:
TopicScreenTestonly drivesTopicUiState.LoadingandTopicUiState.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)
```
Code of Conduct