Skip to content

Define Network backend API expectations - #34

Closed
rchatham wants to merge 2 commits into
feature/network-migration-connection-hardeningfrom
feature/network-migration-api-expectations
Closed

Define Network backend API expectations#34
rchatham wants to merge 2 commits into
feature/network-migration-connection-hardeningfrom
feature/network-migration-api-expectations

Conversation

@rchatham

@rchatham rchatham commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Defines the initial API expectations for the experimental Network framework backend and makes the browser UI path fail predictably instead of reaching MultipeerConnectivity-only state.

Changes

  • Document Network backend support in public API comments:
    • .automatic discovery/connect is supported.
    • .custom + invitePeer is supported for app-owned peer selection.
    • .inviteOnly does not provide MultipeerConnectivity UI with .networkFramework.
    • sendData and sendMessage are supported.
    • streams/resources remain unsupported and report explicit errors.
    • multipeerSession remains MultipeerConnectivity-only.
  • Add a README support matrix comparing MultipeerConnectivity and Network framework behavior.
  • Document app-owned Network peer selection using .foundPeer / .lostPeer and invitePeer, recommending .preSharedKey for authenticated encrypted sessions.
  • Clarify that networkSecurity applies only to .networkFramework; MultipeerConnectivity retains its own MCSession security behavior.
  • Update PeerConnectivityUI.browserViewController to return nil for Network-backed managers instead of touching multipeerSession and triggering a programmer-error fatal path.
  • Add tests covering networkSecurity storage/default behavior and the fact that MultipeerConnectivity ignores the Network security configuration.

Verification

  • swift test — 104 tests passed
  • xcodebuild test -project PeerConnectivity.xcodeproj -scheme PeerConnectivity -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.3.1' -configuration Debug — 104 tests passed
  • Correctness reviewer — no merge-blocking findings
  • Security reviewer — no merge-blocking security findings

Notes / limitations

  • This PR intentionally keeps the Network support matrix as documentation plus predictable UI behavior, not a broader public capability/configuration API.
  • Streams/resources remain follow-up work.
  • A SwiftUI/UIKit-neutral browser replacement remains the next UI-oriented migration slice.

Stack context

Stacked on PR #33 (feature/network-migration-connection-hardening). This is the API expectation stabilization slice of the Network migration stack.

@rchatham
rchatham force-pushed the feature/network-migration-api-expectations branch from 928be06 to 7530830 Compare August 7, 2026 03:51
…tion-hardening' into HEAD

# Conflicts:
#	Sources/PeerConnectivityUI/PeerConnectionManager+UI.swift
@rchatham

Copy link
Copy Markdown
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.

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