Commit Graph

720 Commits

Author SHA1 Message Date
akwizgran e58ca00979 Don't start transactions while holding locks. #272 2016-03-29 15:21:46 +01:00
akwizgran 1855dbbd2d Use a lock to ensure transaction isolation. #272 2016-03-28 13:52:12 +01:00
akwizgran 9714713d73 Add transports to DB during startup. #269 2016-03-28 13:47:23 +01:00
akwizgran 0417639410 Merge duplex and simplex plugin config classes. 2016-03-28 11:28:46 +01:00
str4d 701cfdba48 Extract contact exchange protocol from BT introduction protocol 2016-03-26 15:53:02 +13:00
str4d ce7c189923 Create BQP API 2016-03-26 15:53:02 +13:00
str4d d2d8d9d46e Implement BQP transport descriptors 2016-03-26 15:52:58 +13:00
akwizgran 65316414ea Added toString() method to TransportId. 2016-03-22 16:07:20 +00:00
Ernir Erlingsson 4da63b3800 Modified the project structure, removed module extension and went instead for a non-complete core dependency graph 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 6f233070fe Semi-encapsulated the core/api dependency graphs and created a proper structure to load eager singletons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson 5aba1d79f1 Fixes after comments, also removed the CryptoComoponent from the IdentIcons 2016-03-14 21:02:51 +01:00
Ernir Erlingsson ac5d68df81 Added dependency verifications and removed Splash header 2016-03-14 21:01:21 +01:00
Ernir Erlingsson 1be400eb84 Switched Roboguice/Guice out for Dagger 2 2016-03-14 21:01:21 +01:00
Torsten Grote e8ad11210c Merge branch '266-message-queues' into 'master'
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
2016-03-14 14:56:43 +00:00
akwizgran c615dd1ed1 Merge branch 'bluetooth-race' into 'master'
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
2016-03-09 10:12:05 +00:00
akwizgran efa06527c9 Moved validation interfaces into respective managers. 2016-03-08 16:22:09 +00:00
akwizgran a4d6de0340 Added message queue manager. 2016-03-08 16:07:29 +00:00
akwizgran c9276de399 Renamed validation hooks to incoming message hooks. 2016-03-07 18:36:30 +00:00
akwizgran 0ac67239e3 Fixed race condition when closing redundant sockets.
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.
2016-03-07 11:50:47 +00:00
akwizgran 5998412a8a Use ClientHelper in PrivateMessageFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran d342594313 Use ClientHelper in ForumPostFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran 4ddc34ee01 Added new methods to ClientHelper. 2016-03-04 21:07:33 +00:00
akwizgran 418798b1f0 Added BdfList/Dictionary getters for optional values. 2016-03-04 21:00:05 +00:00
akwizgran 34d34a754a Renamed metadata methods. 2016-02-29 14:29:53 +00:00
akwizgran 640f5484e0 Moved PrivateGroupFactory to clients package. 2016-02-29 14:25:29 +00:00
akwizgran 2e7df53dba Added helper class so clients can use less boilerplate. 2016-02-29 14:23:50 +00:00
akwizgran 9e0add7d4c Renamed BdfWriter methods, added support for NULL_VALUE. 2016-02-29 14:23:49 +00:00
akwizgran 3ce62818aa Renamed BdfReader methods, added convenience methods. 2016-02-29 14:23:49 +00:00
Torsten Grote 9dec498e7e Merge branch 'add-contact-transaction' into 'master'
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
2016-02-29 14:07:33 +00:00
akwizgran e3374b7584 Rename BDF methods. 2016-02-29 11:57:42 +00:00
akwizgran e28dc17881 Helper methods and unit tests for BdfList/Dictionary. 2016-02-26 16:27:24 +00:00
akwizgran 1d89c6cebc 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.
2016-02-26 10:57:32 +00:00
akwizgran 76e6b7cfa9 Convert BDF types in lists and dictionaries. 2016-02-26 10:30:50 +00:00
akwizgran c081c08ff5 New polling logic for Bluetooth. #251
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.
2016-02-22 13:21:05 +00:00
akwizgran 9ad41ea28b Check UTF-8 length of transport ID. 2016-02-19 11:55:40 +00:00
str4d 5a6ab9bb96 Made UniqueId a subclass of Bytes. 2016-02-19 11:55:31 +00:00
akwizgran a6baa5821e Added active flag to contacts. 2016-02-17 18:10:52 +00:00
akwizgran 074892b677 StorageStatus is no longer needed. 2016-02-11 16:26:23 +00:00
akwizgran 146dac056d Broadcast events after committing transactions. 2016-02-11 16:26:22 +00:00
akwizgran de8cc50fb4 Moved transactions out of database component. 2016-02-11 16:26:19 +00:00
akwizgran ef2b2b9710 Removed unneeded visibility methods. 2016-02-11 16:21:53 +00:00
akwizgran 3fa1bbe33e Expose transactions through DatabaseComponent interface. 2016-02-11 16:21:53 +00:00
akwizgran 675ce4bfef Removed direct calls to DB's contact/identity methods. 2016-02-11 16:21:52 +00:00
akwizgran 0c392e8b78 Replaced PacketWriter methods with a constant. 2016-02-11 16:21:26 +00:00
akwizgran 747d9678fe Removed unused PrivateConversation class. 2016-02-11 15:05:14 +00:00
akwizgran a91d500263 Added method for deleting metadata. 2016-02-10 14:01:55 +00:00
akwizgran 00275e260f Allow messages to be deleted. 2016-02-10 14:01:55 +00:00
akwizgran 6e1ec41d21 Handle events that affect list of available forums. 2016-02-10 10:47:30 +00:00
akwizgran 18db17bf5b Moved subscription updates to the client layer. 2016-02-10 10:47:30 +00:00
akwizgran 54272c8836 MessageFactory never throws IOException. 2016-02-10 10:47:29 +00:00