Message queues. #266
A message queue is a group shared by two devices that delivers messages from each device to the other in order. The first 64 bits of the message body contain a sequence number that's incremented for each message sent in a given direction. The incoming and outgoing sequence numbers and information about any messages received out of order and waiting to be delivered are stored in the group metadata.
See merge request !121
Fix race condition when closing redundant Bluetooth sockets
The Bluetooth invitation code has a race condition: if Alice and Bob connect to each other at roughly the same time, they each consider their outgoing socket to be redundant and close it, resulting in both sockets being closed. This can be triggered pretty reliably by using two phones of the same model and pressing 'Continue' at the same time on both phones.
When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks, which Bob can detect by trying to read from both sockets.
Hopefully the Bluetooth invitation code will be retired when #117 is merged, but I'm putting this up for review in case we need to keep Bluetooth as a fallback method.
See merge request !120
When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks. This fixes a race condition where each party picked a different socket and closed the other.
Add contact and transport keys in the same transaction
This avoids a potential problem where the app crashes after adding the contact but before adding the transport keys, leaving the contact unusable.
See merge request !112
The polling interval increases exponentially each time polling is unsuccessful, up to a maximum of 60 minutes. The interval is reset to 2 minutes whenever a connection is made and whenever Bluetooth is re-enabled.
Fix a couple of bugs in settings
1. SettingsFragment wasn't receiving events because it extended BaseFragment rather than BaseEventFragment
2. Removed broken logic for deciding whether to broadcast a SettingsUpdatedEvent
3. Added the namespace to SettingsUpdatedEvent so listeners can decide whether to react
See merge request !97
Run hooks when messages are validated
This patch allows clients to respond to messages reliably. Like the hooks for adding/removing contacts/identities, these hooks may be run more than once - that will be fixed when we have client-layer transactions.
See merge request !95
Avoid potential deadlock in TransportKeyManager. #235
See rambling description on the ticket and in the architecture channel...
Fixes#235.
See merge request !79