Repository navigation
Keep a manual host online when Bonjour updates #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
06f0063
fix(ios): keep a manual host online when Bonjour updates
jaywedgeworth22 ad0bf37
fix(ios): let Cancel leave the pairing sheet for a manual host
jaywedgeworth22 312d7da
fix: address Kodus review findings (PR #69)
5040d10
fix(tests): drop private-looking Tailscale example from CompanionReac…
jaywedgeworth22 e2bcabc
docs(ios): complete PR #69 handoff and address Kodus doc findings
cursoragent c9329dc
Keep pairingDismissed for a real cancel, and return Cancel to the picker
cursoragent fa118a5
autofix: correct exit-demo phase and pair-failure kind on Cancel
claude 0dd7481
autofix: address review comment [2/5]
github-actions[bot] 7054fb0
Scrub repo slug, board id, and contrib path from the PR 69 effort row
cursoragent b918a1d
Merge branch 'main' into grok-build/hh-remote-offline
jaywedgeworth22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Remote host stays online when Bonjour updates | ||
|
|
||
| Sat, Oct 4, 2026. Seat GROK-BUILD. Branch `grok-build/hh-remote-offline`. Pull request #69. Issue #64. | ||
|
|
||
| ## Context & Objective | ||
|
|
||
| repo: `Simple-With-Us/HogHunter`. Pre-work claim posted to `#agent-sync` (topic HogHunter issue #64 manual host offline on Bonjour). | ||
|
|
||
| On the same Wi-Fi, the iPhone companion discovers the Mac with Bonjour (`_hoghunter._tcp`). A phone paired over Tailscale, LAN IP, or custom domain stores `remoteHost` / `remotePort` and reaches the Mac with `NWEndpoint.hostPort` (shipped in PR #75; see `AGENTS.md`). Every Bonjour browse tick called `reconcile()`, which treated a missing Bonjour peer as offline and cleared the live dashboard—even while fetches over the saved address still worked. Issue #64. A second defect re-presented the pairing sheet every three seconds after Cancel when the Mac returned 401 for a rotated code. | ||
|
|
||
| Fleet recall (2026-10-09, query *HogHunter iOS companion Bonjour Tailscale manual host*): board lesson `636727035baf4d3dac0beb2c7ebfb578` and contrib `contrib/AG/2026-10-01/6dd52f92` confirm Tailscale / `hostPort` transport is intentional; issue #64 is the Bonjour-flap bug, not a mandate for Bonjour-only transport. | ||
|
|
||
| ## Changes Made | ||
|
|
||
| - `Sources/Companion/CompanionSnapshot.swift` — `CompanionReach.keepsManualHost` helper shared with the iOS target. | ||
| - `ios/Sources/CompanionModel.swift` — skip offline reconciliation for address-backed saves in `noteDiscovery` / `reconcile`; `pairingDismissed` so `refresh()` does not re-enter `.code` after Cancel; `cancelCode()` paths for manual host vs Wi-Fi-only saved Mac. | ||
| - `Tests/HogHunterTests/CompanionTests.swift` — `testManualHostStaysPutWhenBonjourCannotSeeIt` (RFC 5737 addresses only). | ||
| - `docs/EFFORT-LOG.md` — in-progress row for this branch. | ||
| - `docs/rollouts/2026-10-04-remote-host-bonjour.md` — this note. | ||
|
|
||
| ## Decisions & Trade-offs | ||
|
|
||
| - **Keep manual hosts.** Bonjour browse results are not ground truth for a saved `remoteHost`. `forget()` still clears address-backed saves when the user chooses Forget Mac. | ||
| - **Wi-Fi-only saves stay strict.** When `remoteHost` is nil, losing Bonjour still marks the Mac offline. | ||
| - **Pairing sheet loop.** `pairingDismissed` is set on Cancel and cleared on successful pair or remote connect; while set, 401 responses land in `.offline` with copy instead of re-opening the sheet. | ||
| - **Stale snapshot on transient errors.** After at least one successful fetch, a later network error keeps the last snapshot on screen (unchanged from main). | ||
|
|
||
| ## Verification State | ||
|
|
||
| | Command | Result | | ||
| |---------|--------| | ||
| | `xcodegen generate` | NOT RUN on Linux cloud agent (macOS CI runs this) | | ||
| | `xcodebuild -scheme HogHunter -destination 'platform=macOS' test CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY="" -only-testing:HogHunterTests/CompanionTests/testManualHostStaysPutWhenBonjourCannotSeeIt` | PENDING — requires GitHub Actions `test` job on push | | ||
| | `xcodebuild -scheme HogHunter -destination 'platform=macOS' test` (full macOS unit suite) | PENDING — same CI job | | ||
| | `xcodebuild -scheme HogHunterIOS -destination 'generic/platform=iOS Simulator' build CODE_SIGNING_ALLOWED=NO` | PENDING — CI `build-ios` job | | ||
|
|
||
| Last known green (pre-`pairingDismissed` follow-up, local macOS seat): `CompanionTests` filter above exited 0. | ||
|
|
||
| ## Next Steps & Blockers | ||
|
|
||
| - Merge after CI green on macOS unit tests and iOS simulator build. | ||
| - Owner smoke on a Tailscale-paired phone: confirm dashboard stays live through Bonjour browse churn; rotate pairing code, tap Cancel once, confirm sheet stays dismissed and status shows code mismatch. | ||
| - No TestFlight or credential changes in this pull request. | ||
|
|
||
| ## Zero-Code Findings | ||
|
|
||
| - Kodus “Bonjour-only” findings conflict with product contract (`AGENTS.md`, PR #75, fleet recall above). This change preserves address-backed transport and only stops Bonjour from falsely marking those sessions offline. | ||
| - iOS companion UI has no XCTest target; behavioral fixes are validated via macOS `CompanionReach` tests plus CI iOS compile. | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.