Merge branch '382-message-dependencies-2' into 'master'
Message Dependencies This MR adds a new table to the database to hold message dependencies. It introduces two more message states (pending and delivered) and completely changes the validation and message delivery logic. Since this is a **very invasive** change, please **review carefully**. It is better to catch issues now than having to debug things later. If you notice an area without tests, please let me know. I tried to have tests for all changes. Unfortunately, this MR turned out rather large, but most of it are actually tests and you can review one commit after the other without needing to see the full changelog. 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. This might have changed the semantics in some places and can have unindented side-effects. The `DatabaseComponent` was extended with methods for: * adding dependencies * getting dependencies and states of a message * getting messages that depend on a message (dependents) and their states * getting messages to be delivered (by startup hook) * getting pending messages to be possibly delivered (by startup hook) The `valid` column in the database was renamed to `state` along with the associated methods to better reflect its new extended meaning. Since pending messages should not be available to clients, many database queries have been modified to only return results for delivered messages. I might have missed some. Please check carefully. Also you might want to think about how you could create arbitrarily large transactions by sending malicious messages. Please note that the database version was bumped in this MR. Closes #382 See merge request !198
No related branches found
No related tags found
Showing
- briar-android-tests/src/test/java/org/briarproject/ForumManagerTest.java 348 additions, 36 deletions...ests/src/test/java/org/briarproject/ForumManagerTest.java
- briar-android-tests/src/test/java/org/briarproject/ForumManagerTestComponent.java 21 additions, 0 deletions...test/java/org/briarproject/ForumManagerTestComponent.java
- briar-android-tests/src/test/java/org/briarproject/ForumSharingIntegrationTest.java 20 additions, 13 deletions...st/java/org/briarproject/ForumSharingIntegrationTest.java
- briar-android-tests/src/test/java/org/briarproject/IntroductionIntegrationTest.java 17 additions, 12 deletions...st/java/org/briarproject/IntroductionIntegrationTest.java
- briar-android/src/org/briarproject/android/AndroidNotificationManagerImpl.java 5 additions, 4 deletions.../briarproject/android/AndroidNotificationManagerImpl.java
- briar-android/src/org/briarproject/android/contact/ContactListFragment.java 8 additions, 6 deletions...org/briarproject/android/contact/ContactListFragment.java
- briar-android/src/org/briarproject/android/contact/ConversationActivity.java 6 additions, 4 deletions...rg/briarproject/android/contact/ConversationActivity.java
- briar-android/src/org/briarproject/android/forum/ForumActivity.java 6 additions, 4 deletions...oid/src/org/briarproject/android/forum/ForumActivity.java
- briar-android/src/org/briarproject/android/forum/ForumListFragment.java 9 additions, 9 deletions...src/org/briarproject/android/forum/ForumListFragment.java
- briar-api/src/org/briarproject/api/db/DatabaseComponent.java 44 additions, 2 deletionsbriar-api/src/org/briarproject/api/db/DatabaseComponent.java
- briar-api/src/org/briarproject/api/event/MessageStateChangedEvent.java 42 additions, 0 deletions.../org/briarproject/api/event/MessageStateChangedEvent.java
- briar-api/src/org/briarproject/api/sync/ValidationManager.java 5 additions, 5 deletions...-api/src/org/briarproject/api/sync/ValidationManager.java
- briar-core/src/org/briarproject/db/Database.java 57 additions, 12 deletionsbriar-core/src/org/briarproject/db/Database.java
- briar-core/src/org/briarproject/db/DatabaseComponentImpl.java 53 additions, 12 deletions...r-core/src/org/briarproject/db/DatabaseComponentImpl.java
- briar-core/src/org/briarproject/db/JdbcDatabase.java 209 additions, 38 deletionsbriar-core/src/org/briarproject/db/JdbcDatabase.java
- briar-core/src/org/briarproject/forum/ForumPostValidator.java 11 additions, 4 deletions...r-core/src/org/briarproject/forum/ForumPostValidator.java
- briar-core/src/org/briarproject/sync/ValidationManagerImpl.java 251 additions, 6 deletions...core/src/org/briarproject/sync/ValidationManagerImpl.java
- briar-tests/src/org/briarproject/db/DatabaseComponentImplTest.java 106 additions, 9 deletions...ts/src/org/briarproject/db/DatabaseComponentImplTest.java
- briar-tests/src/org/briarproject/db/H2DatabaseTest.java 353 additions, 21 deletionsbriar-tests/src/org/briarproject/db/H2DatabaseTest.java
- briar-tests/src/org/briarproject/sync/ValidationManagerImplTest.java 661 additions, 13 deletions.../src/org/briarproject/sync/ValidationManagerImplTest.java
Loading
Please register or sign in to comment