commit b3986bf3fae595faa8a3555e1b40df8cd3893adf parent 4247db5bed8c7abc8ffb2544b6c05312ab36f146 Author: Iván Ávalos <avalos@disroot.org> Date: Tue, 18 Aug 2026 12:10:20 +0200 [wallet] do not let an undecodable wallet-core message kill the wallet Diffstat:
| M | wallet/src/main/java/net/taler/wallet/backend/BackendManager.kt | | | 10 | ++++++++-- |
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/backend/BackendManager.kt b/wallet/src/main/java/net/taler/wallet/backend/BackendManager.kt @@ -141,13 +141,19 @@ class BackendManager( try { when (val message = json.decodeFromString<ApiMessage>(msg)) { is ApiMessage.Notification -> { - notificationReceiver.onNotificationReceived(message.payload) + // A throwing receiver must not take the wallet down either. + try { + notificationReceiver.onNotificationReceived(message.payload) + } catch (e: Exception) { + Log.e(TAG, "error handling notification", e) + } } is ApiResponse -> { val id = message.id val cont = requestManager.getAndRemoveContinuation(id) if (cont == null) { - Log.e(TAG, "wallet returned unknown request ID ($id)") + // Normal after a request timed out; wallet-core answered anyway. + Log.w(TAG, "wallet returned unknown request ID ($id)") } else { cont.resume(message) }