Handle Network backend reconnects - #38
Closed
rchatham wants to merge 2 commits into
Closed
Conversation
rchatham
force-pushed
the
feature/network-migration-reconnect-e2e
branch
from
August 7, 2026 17:43
3de9321 to
f0965d9
Compare
rchatham
force-pushed
the
feature/network-migration-reconnect-e2e
branch
from
August 7, 2026 17:51
f0965d9 to
e1a857c
Compare
…eer-e2e' into HEAD
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end coverage for Network backend disconnect/reconnect behavior (peer restart) and adjusts Network transport/session handling to properly emit disconnect cleanup, while also stabilizing the existing multi-peer broadcast E2E test to reduce flakiness.
Changes:
- Add a bounded Network backend reconnect E2E test (
testNetworkBackendReconnectsAfterPeerRestarts). - Update Network receive handling to treat remote receive completion/errors as disconnect signals for cleanup.
- Stabilize the existing multi-peer broadcast E2E test by retrying the broadcast and tolerating duplicate receives.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Sources/PeerConnectionManager.swift | Limits automatic refresh-on-disconnect behavior to MultipeerConnectivity backend to support Network backend reconnect behavior. |
| Sources/NetworkPeerTransport.swift | Adjusts Network receive loop behavior to emit disconnect/cancellation cleanup when the remote side completes/errors. |
| PeerConnectivityTests/NetworkPeerLoopbackTests.swift | Adds reconnect E2E scenario and stabilizes multi-peer broadcast E2E via retry + duplicate-tolerant expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Owner
Author
|
Superseded by consolidated PR #42. No commits were discarded; this branch is preserved as a recovery and reference point. Addressed review findings were replied to and resolved before consolidation. |
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
Adds a bounded Network backend reconnect E2E scenario and fixes the reconnect issues it exposed. Also stabilizes the existing multi-peer broadcast E2E test by retrying the broadcast after connections settle.
Changes
testNetworkBackendReconnectsAfterPeerRestarts.NWListener/NWBrowserinstances.Verification
swift test --filter NetworkPeerLoopbackTests/testNetworkBackendReconnectsAfterPeerRestarts— passedswift test --filter NetworkPeerLoopbackTests— 6 tests passedswift test— 108 tests passedxcodebuild test -project PeerConnectivity.xcodeproj -scheme PeerConnectivity -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.3.1' -configuration Debug— 108 tests passedpull_requestCI — Swift Package Tests and Xcode Project Tests passedpushCI — Swift Package Tests and Xcode Project Tests passedNotes / limitations
Stack context
Stacked on PR #36 (
feature/network-migration-multipeer-e2e). This is the reconnect E2E coverage and fix slice of the Network migration stack.