-
Notifications
You must be signed in to change notification settings - Fork 44
Testing Thali-iOS: BrowserManager throws illegalPeerID #1904
Comments
I suspect the code that throws the exception is this: The reason why the peer is not anymore in the list of available peers, seems to be that we received an event for peer |
Events for peer Since we are listening for |
If nonTCPPeerAvailabilityChangedEvent turning off and on is producing consistently it may be caused by one of our components, but it might also be something random that doesn't depend on ThaliCore or the tests. |
So this was happening because we manually tried to connect to the peer that was not available anymore. This was caused by inappropriate removing unavailable peers, so we tried to connect to the wrong peer in infinite loop. We do not listen to |
@mlesnic there is a different scenario where |
The most important question, I think, is why are we expecting to get peerAvailabilityChanged events when states.started === false? If states.started === false this either means:
In either case, we shouldn't be expecting any more nonTCPPeerAvailabilityChangedEvents and hence no peerAvailabilityChanged events (at least from native sources). So isn't the bug that someone turned off the radios and is still expecting to hear about peer availability? |
@yaronyg Let's look at the original test for simplicity. So to answer your questions:
I would expect that
I'm going to investigate why the EDIT: so I was wrong thinking that the |
The logs of the case when the advertiser on device 2 for some internal MPCF error is reset. https://gist.github.com/enricogior/efc9d64c704dcaf905bfdfc5ba8acf45 |
I was misled by these events:
The problem with those events is that they are bogus events. When the connection to a valid peer fails during the initial handshaking, we should not remove that peer from the available peers since it's still an active advertiser that we can connect to. In the test we remove the peer and therefore, if there aren't other available peers, the test will fail with a timeout error. The trick here is to keep the peer and move it to the end of the list of available peers. A simple fix is just to add |
Tried to run multiple times in a row
Can shift data via parallel connections
test and at some point it was stuck like in infinite loop, becausebrowserManager
throwsillegalPeerID
event that triggers connect retry logic, which tries to connect again and so on. From logs we can see that it looks like it is proper.Logs
The text was updated successfully, but these errors were encountered: