thaliproject / Thali_CordovaPlugin

Thali p2p plugin
MIT License
226 stars 44 forks source link

ThaliCore: dedicated BrowserRelay per generation id #1921

Closed enricogior closed 7 years ago

enricogior commented 7 years ago

This issue is related to https://github.com/thaliproject/Thali_CordovaPlugin/issues/1912

BrowserRelays are stored per PeerID ignoring the generation ID. When connecting to a peer, if a relay for a previous generation is still active, it's used to connect to the remote peer. That behavior is not working and is causing several problems including not properly cleaning up things as mentioned in the issue #1912.

The fix consist in storing each relay based on the PeerID + the generation ID and never try to use an older relay to connect to a peer that has advertised a newer generation.

The first tests show that the performance of creating multiple new sessions in a short amount of time are really good, the replication happens almost instantaneously.

enricogior commented 7 years ago

Fixed in https://github.com/thaliproject/thali-ios/commits/master-enrico-error-handling-tmp