session(_:didRemove:reason:) called with wrong reason

The document says session(_:didRemove:reason:) is called when a peer has ended his session by calling its invalidate(). I expect the removal reason to be .peerEnded but I get .timeout.

Your assumption seems correct, according to doc:

Declaration

  • func invalidate()

Discussion

  • When an app calls this function, NI invokes session(_:didRemove:reason:) on the peer’s side and passes in the reason NINearbyObject.RemovalReason.peerEnded. The app can’t restart invalid sessions.
session(_:didRemove:reason:) called with wrong reason
 
 
Q