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.
Introduce a MessageContext class to be used by all validators
This change will allow to pass message dependencies from the client validators to the `ValidationManager`.
Please see my thoughts in #382 for more details.
See merge request !197
The new activity shows who you are sharing a forum with and who shares a
forum with you. It is accessible from the overflow menu when in a forum.
Closes#398
The code for creating forums in ForumManager was used by
ForumSharingManager and also needed by InviteeEngine.
This extracts it into its own class.
Closes#375
Start plugins asynchronously
This prevents other services from getting stuck behind the plugin manager while the Tor plugin is starting, which takes several seconds. The plugin manager waits for each plugin to start before stopping it.
I've also added some canaries to plugins and services to ensure instances aren't started more than once.
See merge request !181
Poller refactoring, replace Timer with ScheduledExecutorService
* Replace Timer with ScheduledExecutorService (closes#258)
* Move automatic connection logic from PluginManager to Poller
* Reschedule polling when connections are opened or closed, making the poller more responsive to reductions in the polling interval
See merge request !180
Try harder to connect to contacts
* When an outgoing connection is lost, try to reconnect to the contact straight away
* Use periodic polling for Tor, regardless of whether our hidden service descriptor has been published
* Reduce polling intervals for all plugins (this can be reverted if we solve the connectivity issues)
Closes#262, #314. Hopefully helps with #361.
See merge request !177
This commit replaces the old ForumSharingManagerImpl with a new one
which is based on state machines and the ProtocolEngine.
There is a SharerEngine and a InviteeEngine that take care of state
transitions, messages, events and trigger actions to be carried out by
the ForumSharingManagerImpl. This is all very similar to the
Introduction Client.
The general sharing paradigm has been changed from sharing as a state to
sharing as an action. Now the UI can allow users to invite contacts to
forums. The contacts can accept or decline the invitiation. Also, the
Forum Sharing Manger is notified when users leave a forum.
Closes#322
Methods for creating, adding and removing forums have been moved to the
`ForumManager`. In order to still handle removing forums properly, a
`RemoveForumHook` has been introduced.
Methods for sharing forums with all current and future contacts have
been removed along with the localGroup where this information was saved.
The `ShareForumActivity` now has the proper label.
The `SessionId` and the `ProtocolEngine` have been moved to the
`clients` package.
This addresses part of #322 and part of what has been discussed in #320.
Show relevant introduction decline responses in the conversation
* If the user has already declined, we don't show that the other
introducee has declined as well. The backend doesn't have that information, so
this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we now show the
decline response in the private conversation with the introducer. If
the user hasn't yet responded, we hide the accept/decline buttons
in the introduction request message.
Please note that I do not have three devices at the moment to test this MR in its entirety in practice. I created another test which is hopefully sufficient to ensure that the modifications are correct.
Closes#295
See merge request !149
* If the user has already declined, we don't show that the other
introducee has declined as well. The backend doesn't have that information, so
this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we show the
decline response in the private conversation with the introducer. If
the user hasn't yet responded, we hide the accept/decline buttons
in the introduction request message.
Messages an introducee receives in a `FINISHED` state are now being
ignored and deleted.
Closes#295
* normal session where both introducees accept
* normal session where the first introducee declines
* normal session where the second introducee declines
* one session where a contact is introduced to herself
* one session where two identities of the same contact
are introduced to each other
This introduces a new IntroductionAbortedEvent to signal when the
protocol was aborted. It is not yet used in the UI.
It closes#276
* force decline when two of our own identities are introduced to each
other
* throw away introduction requests to the same identity
(impossible to trigger from UI)
Closes#284
When devices' clocks are out of sync, it is possible that a response is
shown before the request. This commit makes sure that the timestamp of
responses is always later than the last message in the conversation.
Some wording could be misunderstood to thing introductions were
successful even though they were not. That has been clarified.
A new database transaction was created when getting contacts and local
transport properties. This has been changed to re-use the existing
transaction.
Also addresses minor issues found in review.
The code made the assumption that a session state can be identified by
the unique session ID. However, when multiple identities from the same
device are involved, there are two sessions with the same ID running on
the device.
Hence, a second identifying criteria has to be used to uniquely identify
the correct session. Here, the ID of the group was chosen.
Unfortunately, the session state can not be cached easily anymore
leading to a small performance penalty when getting all messages for the
UI.
Contact Introduction Backend
This MR allows you to introduce two of your contacts to each other. They both will receive an introduction with an optional message and then can accept or refuse the introduction which is presented as a notification.
When reviewing, I propose to review the individual commits separately as I took great care to split functional independent parts into separate commits. You might also want to have a look at the [Introduction Client Wiki page](https://code.briarproject.org/akwizgran/briar/wikis/IntroductionClient) to better understand what is going on before looking into the actual code.
Protocol sessions and states are not yet deleted and the UI is still missing (#253). In order to practically test this feature, the UI from !122 is needed.
See merge request !116
BQP with QR codes
This MR implements BQP for key agreement over short-range transports. It also implements the Android UI for using BQP with QR codes.
Closes#117.
See merge request !84
This Introduction BSP Client uses its own group to communicate with
existing contacts. It uses four types of messages to facilitate
introductions: the introduction, the response, the ack and the abort.
The protocol logic is encapsulated in two protocol engines, one for the
introducer and one for the introducee. The introduction client keeps the
local state for each engine, hands messages over to the engines and
processes the result and state changes they return.
This requires exposing the `containsContact()` method to the `DatabaseComponent`
and is needed for finding out efficiently whether a contact already exists.