From 5687ec1ff7a3945f2221f79f8146cad2df31f4cf Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Wed, 17 Dec 2025 15:02:10 -0800 Subject: [PATCH] Add better error handling for conversation loading --- .../com/moez/QKSMS/feature/compose/ComposeViewModel.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt index 9228a630..b61e8d63 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt @@ -178,10 +178,15 @@ class ComposeViewModel @Inject constructor( // monitors convos and triggers when wanted convo is present conversationRepo.getConversations(false) .asObservable() - .filter { conversations -> conversations.isLoaded } + .filter { conversations -> conversations.isLoaded && conversations.isValid} .mapNotNull { conversationRepo.getConversation(addresses) } .doOnNext { newState { copy(loading = false) } } - } + } + .doOnError { e -> + Timber.e(e, "Error while resolving conversation") + newState { copy(loading = false) } + } + // Merges two potential conversation sources (constructor threadId and contact selection) // into a single stream of conversations. If the conversation was deleted, notify the