Multipeer Connectivity: On joining a running session, some peers doesn't get connected

Originator:jiayong.ou
Number:rdar://17533347 Date Originated:02-Jul-2014 11:05 AM
Status:Closed Resolved:05-Aug-2014 04:05 PM
Product:iOS Product Version:
Classification: Reproducible:
 
Summary:
When leaving and re-joining a multipeer session with more than two peers, the reconnecting peer only gets connected to the peer it sent the invitation to. 

The session's delegate does get a `session:peer:didChangeState:` call with `MCSessionStateConnected` for the peer that doesn't get connected, but the session's `connectedPeers` array doesn't contain that peer and any attempts to communicate with it fails. E.g. opening a stream fails with `Error Domain=MCSession Code=0 "Peer not connected" UserInfo=0x14658900 {NSLocalizedDescription=Peer not connected}`.

Steps to Reproduce:
Run the attached project on three devices, subsequently called devices A, B and C.

* Device A invites devices B and C to the session by pressing the "Connect" button and sending invitations via the peer browser.
* Devices B and C accepts the invitation
* Session with all three devices connected is established, everything works
* Device A leaves the session by pressing the "Disconnect" button
* Device B invites device A back into the session using the "Connect" button
* Device A accepts the invitation

Expected Results:
A session with peers A, B and C gets established

Actual Results:
Device A and B are connected and can communicate but there is no communication between devices A and C possible. The connection between devices B and C is not affected.

Both devices A and C gets a `session:peer:didChangeState:` method call with `MCSessionStateConnected` in the session delegate, but the session's `connectedPeers` array doesn't contain the peer the delegate was notified of being connected. Also, attempts to communicate with the supposedly connected peers fails.

Version:
iOS 7.1.1, iOS 8.0 beta2

Notes:


Configuration:
iPhone 5, iPad mini retina, iPhone Simulator

Attachments:
'multipeer-reconnect-test.zip' was successfully uploaded.

Comments

Fixed as of iOS 8 beta 5

By jiayong.ou at Aug. 5, 2014, 2:07 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!