Skip to content

Add opt-in Network backend selector - #29

Open
rchatham wants to merge 1 commit into
feature/network-migration-discovery-metadatafrom
feature/network-migration-backend-selector
Open

Add opt-in Network backend selector#29
rchatham wants to merge 1 commit into
feature/network-migration-discovery-metadatafrom
feature/network-migration-backend-selector

Conversation

@rchatham

@rchatham rchatham commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

Adds an explicit opt-in backend selector for the Network.framework migration while preserving MultipeerConnectivity as the default runtime backend.

Changes

  • Add public PeerConnectionBackend:
    • .multipeerConnectivity remains the default.
    • .networkFramework is explicitly opt-in and documented as incomplete parity.
  • Add public PeerConnectionManager.backend for debugging/tests.
  • Extend the existing public initializer with a defaulted backend: parameter, preserving existing call sites.
  • Route .networkFramework through the internal Network transport factory when OS availability permits.
  • Fail explicitly instead of silently falling back on OS versions where Network.framework backend is unavailable.
  • Document multipeerSession as MC-only.
  • Add test coverage proving:
    • default initializer remains MC-backed
    • explicit MC backend remains MC-backed
    • Network backend constructs Network transports
    • Network .automatic starts without switching default behavior
    • Network .inviteOnly starts without MC advertiser assistant UI
    • internal transport-factory initializer remains available and unaffected

Limitations / non-goals

  • No default backend change.
  • No local simulator Alice/Bob loopback test yet.
  • No SwiftUI browser replacement yet.
  • No Network stream/resource parity yet.
  • No public trust/security guarantee for the experimental Network path yet.

Verification

  • swift test — 94 tests passed
  • xcodebuild test -project PeerConnectivity.xcodeproj -scheme PeerConnectivity -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.3.1' -configuration Debug — 94 tests passed
  • GitHub Actions Swift Package Tests — passed
  • GitHub Actions Xcode Project Tests — passed
  • Reviewer pass — no merge-blocking findings
  • Security reviewer pass — no merge-blocking security findings

Stack context

Stacked on PR #28 (feature/network-migration-discovery-metadata). This is the opt-in backend selector slice before local simulator loopback integration.

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