Skip to content

fix(mac): log Bonjour browser state changes - #290

Merged
raiseCatError merged 1 commit into
devfrom
fix/263-discovery-state-logging
Nov 16, 2026
Merged

raiseCatError merged 1 commit into
devfrom
fix/263-discovery-state-logging

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Summary

Option B of #263, approved by the owner: privacy-safe state logging only for the Mac sender's two Bonjour browsers (_opensidecar._tcp receivers and the QUIC hint browser). Neither had a stateUpdateHandler, so a browser stuck in .waiting (for example a Local Network denial) or dead in .failed left no trace.

  • Each browser logs one line per distinct state change, e.g. discovery: browser=receivers state=waiting error=dns:-65570 policyDenied.
  • Lines carry only the role, the state and the error kind and code. No service or device names, TXT contents, endpoints, addresses or install ids.
  • No retry, restart, recovery, UI, protocol or discovery behaviour change. Option C (bounded restart) stays unapproved until the logs or a reproduction show .failed in practice.

Related issue: #263

Scope and compatibility

  • Platforms/components affected: Mac sender (SenderController browsers), new Mac/DiscoveryBrowserStateLog.swift, project.yml (test target source list).
  • User-visible behavior: none; log lines only.
  • Compatibility considerations: none.

Verification

Check Result and evidence
Automated tests / lint / build Local, Xcode 27.1: DiscoveryBrowserStateLogTests 9/9 pass (dedupe, PolicyDenied label, other DNS codes unlabelled, posix formatting, code change logs again, independent browsers, cancelled, NWBrowser.State mapping); LocalNetworkAccessTests 3/3 pass. No new warnings (the SDK's new NWError.wifiAware case is covered by default).
Physical devices tested (models and OS versions) None.
Simulator or emulator (if used) None.
Not tested / known limitations Real .waiting/.failed states were not reproduced; Local Network denial and re-grant, Wi-Fi off/on, sleep/wake with a live session.

Safety and review checklist

  • This is a focused change with no unrelated refactors.
  • Relevant automated checks ran; failures or skipped tests are documented.
  • I distinguished real-device verification from simulator/emulator or unit tests.
  • Existing pairing, security and consent behavior is preserved, or changes are explained.
  • Public screenshots, logs and test data contain no personal data, private endpoints, identifiers, secrets or pairing codes.
  • Documentation, user-facing terminology and accessibility were updated if relevant.
  • No signing material, credentials, provisioning profiles or local build artifacts are included.
  • This PR does not tag, release, publish, or alter protected release workflows without explicit maintainer coordination.

Notes for reviewers

The existing DEBUG-only pairing browser still logs its own state with more detail; it was left alone (out of scope).

Issue #263: the Mac sender's Bonjour browsers had no stateUpdateHandler, so a
browser stuck in .waiting (for example a Local Network privacy denial) or dead
in .failed left no trace in the logs.

This is option B only: state logging. Both the _opensidecar._tcp receiver
browser and the QUIC hint browser now log one line per distinct state change.
There is no retry, restart, recovery, UI, protocol or discovery behaviour change.

Lines carry only the browser role, the state and the error kind and numeric
code, with DNS PolicyDenied (-65570) labelled. They never include service or
device names, TXT contents, endpoints, addresses or install ids.

The dedupe and formatting live in a Network-free helper so they are unit
testable.
@raiseCatError
raiseCatError marked this pull request as ready for review November 16, 2026 07:21
@raiseCatError
raiseCatError merged commit 4ea5cd8 into dev Nov 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant