dxos-deprecated / mesh

GNU Affero General Public License v3.0
0 stars 1 forks source link

Signal messages are lost if the receiving peer just recently joined #57

Open dmaretskyi opened 3 years ago

dmaretskyi commented 3 years ago

Consider this situation:

apollo1   ------    apollo2
   |                   |
   |                   |
peer1                 peer2
  1. peer1 joins @ apollo1
  2. Some time passes
  3. peer2 joins @ apollo2
  4. peer2 receives peer1 as peer candidate
  5. peer2 sends offer to peer1
  6. peer1 answers

At this point both apollo1 and 2 have know about peer1, but only apollo2 knows about peer2 since the registration data hasn't yet been replicated to apollo1.

peer2 can reach peer1 with signal messages, but peer1 can't reach peer2.

Reproduced in #56

Possible solutions

  1. Retry failed signals: would require custom reliable transfer protocol
  2. Wait for the registration to be replicated. This can be achieved by repeatedly querying the signal server until it has the data about the remote peer.