From e84f171a9107a2e51a2fa7fab0ba6013e6b2f717 Mon Sep 17 00:00:00 2001 From: Strycher Date: Sun, 14 Jun 2026 12:13:20 -0400 Subject: [PATCH] fix(#22): log radio-stats send failure + channel-unread persist failure Two more connector silent-failures from the review. requestRadioStats had an empty 'catch (_) {}' (now logs). setChannelUnreadCount fired unawaited(saveChannels) with no error path (now .catchError + logs). Verified: setContactUnreadCount calls a void debounced store method -- no call-site Future (Gemini false positive); the actual swallow is inside unread_store's debounce timer, flagged separately. Co-Authored-By: Claude Opus 4.8 --- lib/connector/meshcore_connector.dart | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/connector/meshcore_connector.dart b/lib/connector/meshcore_connector.dart index 34a4f80..9c25be2 100644 --- a/lib/connector/meshcore_connector.dart +++ b/lib/connector/meshcore_connector.dart @@ -760,9 +760,14 @@ class MeshCoreConnector extends ChangeNotifier { if (channel != null) { channel.unreadCount = count; unawaited( - _channelStore.saveChannels( - _channels.isNotEmpty ? _channels : _cachedChannels, - ), + _channelStore + .saveChannels(_channels.isNotEmpty ? _channels : _cachedChannels) + .catchError((Object e) { + _appDebugLogService?.error( + 'Failed to persist channel unread count: $e', + tag: 'ChannelStore', + ); + }), ); notifyListeners(); } @@ -2665,7 +2670,12 @@ class MeshCoreConnector extends ChangeNotifier { if (!supportsCompanionRadioStats) return; try { await sendFrame(buildGetStatsFrame(statsTypeRadio)); - } catch (_) {} + } catch (e) { + _appDebugLogService?.error( + 'Failed to request radio stats: $e', + tag: 'RadioStats', + ); + } } Future setPathHashMode(int mode) async {