Match a by-AP search to BSSIDs only when it looks like one #167

Merged
aluminum-ice merged 1 commit from networks-search-names into main 2026-11-03 06:55:52 +00:00
Owner

What this PR does

Fixes the Captured networks search in the by-access-point view, where searching for a network name listed most access points.

A by-AP search also matches BSSIDs, so a pasted MAC finds its radio. It built the BSSID fragment by keeping the query's hex characters (0-9, a-f) whatever the query was. A name's letters a–f became the fragment: "Home" became e and matched nearly every BSSID, and "Library WiFi" became baf.

  • web.py: a new _mac_query() treats the query as a BSSID only when it's made of hex digits and MAC separators (:, -, .), with a separator or at least six digits (AA:BB, 00-00-5e, aabbcc). Any other query matches names only, as the search box suggests.
  • The by-network view never searched BSSIDs and is unchanged.

Checklist

  • Lint passes — make lint (ansible --syntax-check, yamllint, shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.
  • Tests pass — make test: 1674 passed locally, with the two tests that only fail off a device deselected (test_main_ignores_sighup, test_gps_serial_reader_recovers_from_a_stalled_link). The Test workflow runs it on the PR.
  • Nothing real: no secrets, no personal information, no real data. RFC 7042 MACs and placeholder names only.
  • Consent gates intact. Search only.
  • Docs updated in the same PR. No change needed: the guide already says the by-AP search "also matches a pasted BSSID", which still holds.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — the kestrel_pi package only.
  • Reflash-class

Notes for review

  • New test_networks_ap_search_by_name_ignores_bssid_hex fails on main ("Home" matched all three radios) and passes here. It also checks that a fragment with separators, a full MAC with dashes, and six bare digits still find the radio. test_mac_query_only_reads_mac_shaped_searches covers the helper.
  • An all-hex name of six or more characters (say "facade") still also matches BSSIDs containing it. That's rare and harmless: name matches are still found.
  • Found on a device while testing 1.0.13-beta.3. It's older than this beta, so it goes into the next one.

🤖 Generated with Claude Code

## What this PR does Fixes the Captured networks search in the by-access-point view, where searching for a network name listed most access points. A by-AP search also matches BSSIDs, so a pasted MAC finds its radio. It built the BSSID fragment by keeping the query's hex characters (`0-9`, `a-f`) whatever the query was. A name's letters a–f became the fragment: "Home" became `e` and matched nearly every BSSID, and "Library WiFi" became `baf`. - **`web.py`**: a new `_mac_query()` treats the query as a BSSID only when it's made of hex digits and MAC separators (`:`, `-`, `.`), with a separator or at least six digits (`AA:BB`, `00-00-5e`, `aabbcc`). Any other query matches names only, as the search box suggests. - The by-network view never searched BSSIDs and is unchanged. ## Checklist - [x] **Lint passes** — `make lint` (ansible `--syntax-check`, `yamllint`, `shellcheck --severity=error`, and the real-data check). The **Lint** workflow runs this on the PR. - [x] **Tests pass** — `make test`: 1674 passed locally, with the two tests that only fail off a device deselected (`test_main_ignores_sighup`, `test_gps_serial_reader_recovers_from_a_stalled_link`). The **Test** workflow runs it on the PR. - [x] **Nothing real: no secrets, no personal information, no real data.** RFC 7042 MACs and placeholder names only. - [x] **Consent gates intact.** Search only. - [x] **Docs updated in the same PR.** No change needed: the guide already says the by-AP search "also matches a pasted BSSID", which still holds. - [x] Commit messages are short and imperative. ## Release impact - [x] **App-layer-safe** — the `kestrel_pi` package only. - [ ] **Reflash-class** ## Notes for review - New `test_networks_ap_search_by_name_ignores_bssid_hex` fails on main ("Home" matched all three radios) and passes here. It also checks that a fragment with separators, a full MAC with dashes, and six bare digits still find the radio. `test_mac_query_only_reads_mac_shaped_searches` covers the helper. - An all-hex name of six or more characters (say "facade") still also matches BSSIDs containing it. That's rare and harmless: name matches are still found. - Found on a device while testing 1.0.13-beta.3. It's older than this beta, so it goes into the next one. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Match a by-AP search to BSSIDs only when it looks like one
All checks were successful
Test / test (pull_request) Successful in 32s
Lint / lint (pull_request) Successful in 33s
Test / test (push) Successful in 32s
Lint / lint (push) Successful in 33s
407465af35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch networks-search-names 2026-11-03 06:55:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!167
No description provided.