Skip to content

feat: add Network migration infrastructure and opt-in backend - #29

Closed
rchatham wants to merge 9 commits into
feature/network-migration-discovery-metadatafrom
feature/network-migration-backend-selector
Closed

rchatham wants to merge 9 commits 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

Turn the initial Network.framework prototype into a safely selectable backend with the migration infrastructure required by later work.

Changes

  • Add the Network migration CI baseline and framework-neutral compile/test coverage.
  • Serialize observable and multi-observable mutation while preserving synchronous delivery semantics.
  • Add async observable scaffolding.
  • Add Network listener, browser, advertiser, and session transport adapters.
  • Add bounded Bonjour discovery metadata with UTF-8 byte-safe TXT records and local-self filtering.
  • Add the public opt-in backend selector while preserving MultipeerConnectivity as the default.
  • Add public optional availableMultipeerSession feature detection while retaining the existing multipeerSession API.
  • Remove unused Network coordinator advertiser-observer plumbing.
  • Incorporate secure peer-identity archiving, handshake-error propagation, and efficient frame decoding from the updated base.

Compatibility

Existing initializers and Multipeer-backed behavior remain source-compatible. Apps must explicitly choose .networkFramework; MultipeerConnectivity remains the default and fallback path. availableMultipeerSession allows callers to feature-detect the MC-specific session without triggering the existing non-optional accessor's unsupported-backend precondition.

Security and discovery

Discovery TXT entries are bounded by encoded UTF-8 byte length, reject malformed oversized records, and preserve valid scalar boundaries. Discovery metadata remains self-asserted and is not an authorization identity.

Verification

  • swift test — 140 tests passed locally.
  • iPhone 16 / iOS 18.3.1 Xcode tests — 140 tests passed locally.
  • Added backend selection, optional-session, identity, handshake-failure, frame-decoder, TXT-boundary, multibyte, and truncated-self-filter coverage.
  • Correctness and security reviews found no blockers.

Stack

@rchatham

Copy link
Copy Markdown
Owner Author

GitHub prevents changing the base of a pull request that is registered as part of a stack. Closing this retained checkpoint so it can be recreated with the consolidated base; the branch, commits, review history, and this PR remain preserved.

@rchatham rchatham closed this Aug 11, 2026
@rchatham

Copy link
Copy Markdown
Owner Author

Replaced by consolidated PR #57: #57

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