Commit Graph

69 Commits

Author SHA1 Message Date
Torsten Grote 743fc7dd1f Do not require an entire Message for the MessageSharedEvent 2016-08-29 13:36:09 -03:00
Torsten Grote e690bcb3cc Add introduced contacts as UNVERIFIED
Closes #580
2016-08-19 12:31:00 -03:00
Torsten Grote bdb876552d Allow Validator to access metadata for pending messages
Database queries for metadata only returned it for messages that were delivered already.
However, there are cases (e.g. a pending message needs to be delivered) where
the validator needs to retrieve the metadata from the database.

For these cases, a special database query has been introduced.
2016-07-29 15:17:18 -03:00
Torsten Grote 59320f02b7 Remove MAX_GROUP_DESCRIPTOR_LENGTH
Closes #441
2016-06-22 11:47:38 -03:00
Torsten Grote b03d0a206b Add Message Dependencies to Database
This adds a new table to the database to hold message dependencies.
It introduces two more message states: pending and delivered
The valid column in the database was renamed to state to better reflect
its new extended meaning.

The DatabaseComponent was extended with three methods for:
* adding dependencies
* getting dependencies of a message
* getting messages that depend on a message (dependents)
* getting messages to be delivered (by startup hook)
* getting pending messages to be possibly delivered (by startup hook)

In order to reflect the new states, things that were previously true for
VALID messages have been changed to now be true for DELIVERED messages.

Since pending messages should not be available to clients, many database
queries have been modified to only return results for delivered
messages.

All added methods and changes should come with updated unit tests.

Please note that the database version was bumped in this commit.
2016-05-26 13:49:03 -03:00
akwizgran f2ab0eff53 Simple metadata queries. #222
Added support for retrieving metadata that matches all key/value pairs in a query.
2016-05-12 17:40:11 +01:00
akwizgran 40022b8326 Don't allow local identities to be added as contacts. 2016-04-11 13:24:25 +01:00
akwizgran 205dc66572 Test cleanup. #280 2016-04-05 14:19:10 +01:00
akwizgran 7e3d3625aa Don't allow reentrant transactions.
The database's transaction lock is reentrant, meaning that a thread that's already holding the lock can acquire it again. This would allow a thread that already has a transaction in progress to start another transaction, which could cause transaction isolation issues and/or lock timeouts on the database's internal locks.

Check that the current thread isn't already holding the lock when starting a transaction.
2016-03-31 11:02:52 +01:00
akwizgran 685a864b43 Unit tests for transaction isolation. #272 2016-03-28 13:52:54 +01:00
akwizgran 1855dbbd2d Use a lock to ensure transaction isolation. #272 2016-03-28 13:52:12 +01:00
akwizgran 8a20f330be Broadcast status event when active contact is added. 2016-02-19 12:10:44 +00:00
akwizgran b7dc13ab53 Added unit test for setting contact active. 2016-02-18 10:10:12 +00:00
akwizgran a6baa5821e Added active flag to contacts. 2016-02-17 18:10:52 +00:00
akwizgran 6b76b75d08 More efficient database joins.
Don't keep message status rows for groups that are invisible to the contact - this avoids the need to join the groupVisibilities table when selecting messages to offer or send. Add or remove status rows when group visibility changes.
2016-02-17 17:24:44 +00:00
akwizgran 9f8baab60f Code cleanup. 2016-02-11 16:26:23 +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 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 18db17bf5b Moved subscription updates to the client layer. 2016-02-10 10:47:30 +00:00
akwizgran fd99dd7573 Updated a unit test for storing settings. 2016-02-10 10:47:29 +00:00
akwizgran 225d0ebeef DB interface cleanup, removed unnecessary exceptions. 2016-02-10 10:47:29 +00:00
akwizgran 3837efca6b Updated group-related events and exceptions. 2016-02-10 10:47:26 +00:00
akwizgran 9d537dce00 Removed contact subscriptions from database. 2016-02-10 10:46:41 +00:00
akwizgran 9fdc510843 Removed SubscriptionUpdate and SubscriptionAck. 2016-02-10 10:46:41 +00:00
akwizgran 3d948ed461 Don't broadcast an event unless settings have changed. 2016-02-08 11:17:45 +00:00
akwizgran 3697fc6eb1 Allow different identities to have the same contact. 2016-02-02 17:00:54 +00:00
akwizgran e76aef3dc8 Unshared messages. 2016-01-29 13:45:22 +00:00
akwizgran 0fd8a67ee0 Allow multiple identities to have the same contact. #224 2016-01-28 15:57:22 +00:00
akwizgran 88475bdd54 Transport properties client. #229 2016-01-27 12:51:55 +00:00
akwizgran cd175fd119 Removed TransportUpdate and TransportAck. 2016-01-27 12:51:54 +00:00
akwizgran 88a8081351 Metadata for groups. #221 2016-01-20 15:03:42 +00:00
akwizgran 281ca734e3 Addressed issues from code review. 2016-01-20 14:43:47 +00:00
akwizgran c4692a7007 Identity manager hooks. #209 2016-01-20 14:43:47 +00:00
akwizgran 82cf12040f Contact manager hooks. #209 2016-01-20 14:43:46 +00:00
akwizgran 77054cbae7 Small improvements to DB interface. 2016-01-20 10:35:14 +00:00
akwizgran 5355951466 Separate the sync layer from its clients. #112 2016-01-20 10:35:09 +00:00
Santiago Torres 190bb12964 ENH: Replaces transport config with namespaced settings 2016-01-20 00:57:16 -05:00
akwizgran c5282c5b17 Moved some API classes into packages. 2015-12-17 16:56:57 +00:00
akwizgran 60a5b28e57 Renamed DatabaseComponentTest. 2015-12-16 12:17:38 +00:00
akwizgran 6e61504d24 Removed message expiry code. #180 2015-12-16 12:17:38 +00:00
akwizgran 2ca2356ecc Moved MessageHeader to sync package. 2015-12-15 15:05:16 +00:00
akwizgran e370cafb12 Moved classes from messaging package to sync package. 2015-12-15 15:05:06 +00:00
akwizgran 6dc225d037 Refactor KeyManager and TagRecogniser. #55 2015-12-14 11:05:37 +00:00
akwizgran 9868feeb2a Refactor KeyManager and TagRecogniser. #55 2015-12-14 11:02:49 +00:00
akwizgran 912ba394c5 Refactored FileUtils.
Removed methods that are no longer needed for Java 6, moved the remaining method into the utils directory.
2015-12-10 15:58:52 +00:00