Repository navigation
fix(mac): log Bonjour browser state changes - #290
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Option B of #263, approved by the owner: privacy-safe state logging only for the Mac sender's two Bonjour browsers (
_opensidecar._tcpreceivers and the QUIC hint browser). Neither had astateUpdateHandler, so a browser stuck in.waiting(for example a Local Network denial) or dead in.failedleft no trace.discovery: browser=receivers state=waiting error=dns:-65570 policyDenied..failedin practice.Related issue: #263
Scope and compatibility
SenderControllerbrowsers), newMac/DiscoveryBrowserStateLog.swift,project.yml(test target source list).Verification
DiscoveryBrowserStateLogTests9/9 pass (dedupe, PolicyDenied label, other DNS codes unlabelled, posix formatting, code change logs again, independent browsers, cancelled,NWBrowser.Statemapping);LocalNetworkAccessTests3/3 pass. No new warnings (the SDK's newNWError.wifiAwarecase is covered bydefault)..waiting/.failedstates were not reproduced; Local Network denial and re-grant, Wi-Fi off/on, sleep/wake with a live session.Safety and review checklist
Notes for reviewers
The existing DEBUG-only pairing browser still logs its own state with more detail; it was left alone (out of scope).