Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/services/debug_diagnostics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion prop
Submodule prop updated from 9ad4f7 to dc4e45
34 changes: 34 additions & 0 deletions test/services/debug_diagnostics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down