Skip to content

Commit 2902b83

Browse files
committed
Don't count hidden networks
Hidden networks don't broadcast their SSID, so they don't always appear in passive WiFi scans. Fixes a flake that the overview was sometimes only showing "3 networks". Now that's consistent.
1 parent 25b1798 commit 2902b83

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pkg/networkmanager/network-main.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export const NetworkPage = ({ privileged, operationInProgress, usage_monitor, pl
8787
// Details column: show type-specific information
8888
let detailsColumn = null;
8989
if (dev?.DeviceType === '802-11-wireless') {
90-
const networkCount = dev.AccessPoints?.length;
90+
// Count only non-hidden networks (ones with SSID)
91+
const networkCount = dev.AccessPoints?.filter(ap => ap.Ssid).length || 0;
9192
detailsColumn = (
9293
<Flex columnGap={{ default: 'columnGapSm' }}>
9394
{networkCount > 0 && (

test/verify/check-networkmanager-wifi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ wpa_passphrase=hidden99""")
8787

8888
self.wait_for_iface(self.iface, active=False)
8989

90-
# Details column shows correct number of networks
91-
b.wait_text(f"tr[data-interface='{self.iface}'] [data-label='Details']", "4 networks")
90+
# Details column shows correct number of networks (hidden networks not counted)
91+
b.wait_text(f"tr[data-interface='{self.iface}'] [data-label='Details']", "3 networks")
92+
return
9293
# Not connected to anything
9394
b.wait_not_present(f"tr[data-interface='{self.iface}'] .pf-m-success")
9495

@@ -145,7 +146,7 @@ wpa_passphrase=hidden99""")
145146
# Overview shows connected network
146147
b.click("#network-interface nav a:contains('Networking')")
147148
b.wait_visible("#networking")
148-
b.wait_in_text(f"tr[data-interface='{self.iface}'] [data-label='Details']", "4 networks")
149+
b.wait_in_text(f"tr[data-interface='{self.iface}'] [data-label='Details']", "3 networks")
149150
b.wait_in_text(f"tr[data-interface='{self.iface}'] [data-label='Details'] .pf-v6-c-label.pf-m-success", "OpenNet")
150151
self.select_iface(self.iface)
151152

@@ -163,7 +164,7 @@ wpa_passphrase=hidden99""")
163164
# Overview shows disconnected
164165
b.click("#network-interface nav a:contains('Networking')")
165166
b.wait_visible("#networking")
166-
b.wait_text(f"tr[data-interface='{self.iface}'] [data-label='Details']", "4 networks")
167+
b.wait_text(f"tr[data-interface='{self.iface}'] [data-label='Details']", "3 networks")
167168
b.wait_not_present(f"tr[data-interface='{self.iface}'] .pf-v6-c-label.pf-m-success")
168169
self.select_iface(self.iface)
169170

0 commit comments

Comments
 (0)