From 274a6ba63440b7f7ff8077dc6ba8642aa1060871 Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Thu, 30 Jul 2026 21:52:25 +0200 Subject: [PATCH] diag: show repeat counts in the mDNS query log; bump prop submodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renders "×N" on folded entries so a continuous poller reads as one line that fired N times rather than silently occupying one slot. Single occurrences stay unmarked. Picks up the prop-side fold + the 40 -> 200 ceiling, after a field capture filled the whole buffer in eight seconds and lost the window that mattered. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01PanTG9kRBi4QTQ2psvpTxP --- lib/services/debug_diagnostics.dart | 5 +++- prop | 2 +- test/services/debug_diagnostics_test.dart | 34 +++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/lib/services/debug_diagnostics.dart b/lib/services/debug_diagnostics.dart index 1f1bb23b..cb039733 100644 --- a/lib/services/debug_diagnostics.dart +++ b/lib/services/debug_diagnostics.dart @@ -183,9 +183,12 @@ class DebugDiagnostics { } else { for (final q in recentQueries) { final at = q.at.toIso8601String().split('T').last.split('.').first; + // Repeats are folded; the count keeps a continuous poller visible as + // one line instead of hiding that it fired hundreds of times. + final repeats = q.count > 1 ? ' ×${q.count}' : ''; b.writeln( ' $at ${q.source}:${q.sourcePort} ${q.wantsUnicast ? 'QU' : 'QM'} ' - '${q.questions.join(', ')} → ${q.reply}', + '${q.questions.join(', ')} → ${q.reply}$repeats', ); } } diff --git a/prop b/prop index 9ad4f70f..dc4e456e 160000 --- a/prop +++ b/prop @@ -1 +1 @@ -Subproject commit 9ad4f70f1fa1acd3f7b0b594b469fcc7099d3355 +Subproject commit dc4e456ea429bb413f0d680b8bd8ccce60e9a0d1 diff --git a/test/services/debug_diagnostics_test.dart b/test/services/debug_diagnostics_test.dart index 112a4f0f..f87cb02c 100644 --- a/test/services/debug_diagnostics_test.dart +++ b/test/services/debug_diagnostics_test.dart @@ -114,6 +114,40 @@ void main() { expect(text, contains('unicast+multicast')); }); + test('marks a folded entry with its repeat count', () { + final text = withQueries([ + MdnsQueryLogEntry( + at: DateTime(2026, 7, 30, 20, 32, 33), + source: '172.20.176.1', + sourcePort: 5353, + wantsUnicast: false, + questions: const ['PTR _oculusal_sp._tcp.local'], + answeredUnicast: false, + answeredMulticast: false, + count: 17, + ), + ]).toText(); + + expect(text, contains('×17')); + expect(text, contains('no answer')); + }); + + test('a single occurrence carries no count marker', () { + final text = withQueries([ + MdnsQueryLogEntry( + at: DateTime(2026, 7, 30, 20, 32, 38), + source: '192.168.0.87', + sourcePort: 5353, + wantsUnicast: true, + questions: const ['PTR _openbikecontrol._tcp.local'], + answeredUnicast: true, + answeredMulticast: false, + ), + ]).toText(); + + expect(text, isNot(contains('×'))); + }); + test('says so when nothing has queried us', () { // The decisive line for "the trainer app on this machine cannot see // BikeControl": if no query ever arrived, the problem is upstream of our