briar issueshttps://code.briarproject.org/briar/briar/-/issues2021-01-20T12:34:20Zhttps://code.briarproject.org/briar/briar/-/issues/753Listener interfaces have mixed responsibilities2021-01-20T12:34:20ZakwizgranListener interfaces have mixed responsibilitiesThe UI makes heavy use of listener interfaces that inherit from either DestroyableContext or BaseFragmentListener. These are used for various purposes:
* Callbacks from a controller to the UI (e.g. `TransportStateListener#stateUpdate()`...The UI makes heavy use of listener interfaces that inherit from either DestroyableContext or BaseFragmentListener. These are used for various purposes:
* Callbacks from a controller to the UI (e.g. `TransportStateListener#stateUpdate()`)
* Injecting dependencies into fragments (`BaseFragmentListener#getActivityComponent()`)
* Manipulating other parts of the UI (e.g. `CreateGroupListener#showSoftKeyboard()`)
* Running tasks (`DestroyableContext#runOnUiThreadUnlessDestroyed()`, `BaseFragmentListener#runOnDbThread()` (deprecated))
These different purposes would ideally be separated into different interfaces. Maybe it would clarify things if communication from controllers back to the UI used the "listener" name and communication between fragments and their activities used some other name.
Listeners are usually provided by casting an Activity or Context (passed to `ActivityLifecycleController#onActivityCreate()` or `Fragment#onAttach()`) to an arbitrary listener interface. This is a bit of a hack - it would be nice if we could provide listeners in a type-safe way, for example by injection.
Related to #752.https://code.briarproject.org/briar/briar/-/issues/751Emoji flicker when BriarRecyclerView updates itself2020-11-21T16:23:47ZakwizgranEmoji flicker when BriarRecyclerView updates itselfWhen BriarRecyclerView updates itself once per minute, emoji visibly flicker.When BriarRecyclerView updates itself once per minute, emoji visibly flicker.https://code.briarproject.org/briar/briar/-/issues/750ANR when copying and pasting long strings of emoji2020-11-21T16:24:41ZakwizgranANR when copying and pasting long strings of emojiCopying and pasting long strings of emoji from EmojiTextView to EmojiEditText is very slow and can produce an ANR dialog. The delay increases superlinearly with the number of emoji, and depends on the existing contents of the EmojiEditTe...Copying and pasting long strings of emoji from EmojiTextView to EmojiEditText is very slow and can produce an ANR dialog. The delay increases superlinearly with the number of emoji, and depends on the existing contents of the EmojiEditText.
With the Huawei Ascend Y330:
* 64 emoji: noticeable delay
* 128 emoji: 6 seconds if EmojiEditText is empty, 20 seconds if it already contains 128 emoji
* 256 emoji: 30 seconds if EmojiEditText is empty, 100 seconds if it already contains 256 emoji
With the Samsung Galaxy Ace 2:
* 128 emoji: noticeable delay
* 256 emoji: 6 seconds if EmojiEditText is empty, 18 seconds if it already contains 256 emoji
* 512 emoji: 37 seconds if EmojiEditText is empty, 135 seconds if it already contains 512 emoji
![device-2016-11-10-155441](/uploads/39033afde37e12b0840b97260d775389/device-2016-11-10-155441.png)
![device-2016-11-10-155523](/uploads/877491aa8bde25c54ef75d51632b8bec/device-2016-11-10-155523.png)
These problems don't occur when copying and pasting ordinary text from an EmojiTextView to an EmojiEditText. Thousands of characters can be copied and pasted without a noticeable delay.https://code.briarproject.org/briar/briar/-/issues/745Refactor redundant code in AndroidNotificationManagerImpl2020-11-21T16:26:13ZakwizgranRefactor redundant code in AndroidNotificationManagerImplAndroidNotificationManagerImpl contains blocks of nearly identical code for doing things like counting new messages per-group or per-contact, and blocking or unblocking notifications per-client. These could be refactored to reduce redund...AndroidNotificationManagerImpl contains blocks of nearly identical code for doing things like counting new messages per-group or per-contact, and blocking or unblocking notifications per-client. These could be refactored to reduce redundancy.
(ConnectionRegistryImpl also contains similar code for counting connections per-contact. Maybe this could be factored out into a separate `Counter<T>` class.)https://code.briarproject.org/briar/briar/-/issues/744Use global constants for View's alpha values2020-11-21T16:27:13ZErnir ErlingssonUse global constants for View's alpha valuesIn several places in the app we're decreasing the opacity of views to represent things such as disabled states. Unfortunately, we're doing this through hard-coded float values at each location. We should rather use global constants and m...In several places in the app we're decreasing the opacity of views to represent things such as disabled states. Unfortunately, we're doing this through hard-coded float values at each location. We should rather use global constants and make sure that every occurrence uses them -- this will make it easier for us to modify it in the future to fit any design pattern.https://code.briarproject.org/briar/briar/-/issues/743Create a controller for ConversationActivity to encapsulate the UI code2020-11-21T16:27:52ZErnir ErlingssonCreate a controller for ConversationActivity to encapsulate the UI codehttps://code.briarproject.org/briar/briar/-/issues/739StrictMode violation: DroidtoothPlugin does not release resource2020-11-21T16:28:28ZTorsten GroteStrictMode violation: DroidtoothPlugin does not release resourceThis shows up from time to time in the log of my test device during normal operation.
```
StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
...This shows up from time to time in the log of my test device during normal operation.
```
StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
at android.bluetooth.IBluetooth$Stub$Proxy.connectSocket(IBluetooth.java:1684)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:311)
at org.briarproject.plugins.droidtooth.DroidtoothPlugin.connect(DroidtoothPlugin.java:331)
at org.briarproject.plugins.droidtooth.DroidtoothPlugin.access$1100(DroidtoothPlugin.java:62)
at org.briarproject.plugins.droidtooth.DroidtoothPlugin$3.run(DroidtoothPlugin.java:298)
```https://code.briarproject.org/briar/briar/-/issues/730Remove redundant setup code from jMock tests2020-11-21T16:29:33ZakwizgranRemove redundant setup code from jMock testsIt's safe to reuse a Mockery and mocked objects across multiple tests - if unexpected or missing invocations cause a test to fail, the expectations are reset before running the next test. Setup code can therefore be moved from the indivi...It's safe to reuse a Mockery and mocked objects across multiple tests - if unexpected or missing invocations cause a test to fail, the expectations are reset before running the next test. Setup code can therefore be moved from the individual tests to the class in many cases.https://code.briarproject.org/briar/briar/-/issues/729Blog posts should be created on the crypto executor2020-11-21T16:34:09ZakwizgranBlog posts should be created on the crypto executorWriteBlogPostActivity creates blog posts on the DB executor. They should be created on the crypto executor and stored on the DB executor using chaining.
(BlogManagerImpl similarly creates comments on the DB executor, but that would be m...WriteBlogPostActivity creates blog posts on the DB executor. They should be created on the crypto executor and stored on the DB executor using chaining.
(BlogManagerImpl similarly creates comments on the DB executor, but that would be much harder to disentangle.)https://code.briarproject.org/briar/briar/-/issues/728Don't change list indices during validation2020-11-23T11:39:37ZakwizgranDon't change list indices during validationSome validation hooks pop the message type off the list representing the message body before validating the remaining items. This is due to poorly written specs that didn't include the message type in the list. The list should be left un...Some validation hooks pop the message type off the list representing the message body before validating the remaining items. This is due to poorly written specs that didn't include the message type in the list. The list should be left unmodified for easier comparison with the corrected spec.https://code.briarproject.org/briar/briar/-/issues/725Result handlers may not return results if the screen is rotated2020-11-21T16:36:20ZakwizgranResult handlers may not return results if the screen is rotatedThis issue came to mind while reviewing !354 - `SetupActivity#onClick()` uses the onResultUi() method of a UiResultHandler to start the next activity. If the screen's rotated before the handler returns, the original activity will be dest...This issue came to mind while reviewing !354 - `SetupActivity#onClick()` uses the onResultUi() method of a UiResultHandler to start the next activity. If the screen's rotated before the handler returns, the original activity will be destroyed, so the handler will never call onResultUi(). The outcome, as far as I can see, will be a progress wheel that spins forever.
Similar problems may exist elsewhere. Most of the time we use ResultHandlers to update the state of the current activity or fragment, and we reload everything if the activity or fragment's recreated, so it doesn't matter if results are lost during rotation. But there may be some places like this one where we depend on the result being returned.https://code.briarproject.org/briar/briar/-/issues/721UX design for showing client protocol errors in the UI2020-11-21T16:37:13ZakwizgranUX design for showing client protocol errors in the UIIf we receive an invalid sequence of messages in a client protocol, it may not be possible to continue with the protocol. If this makes certain actions unavailable to the user, the UI should inform the user about that in some way.
We sh...If we receive an invalid sequence of messages in a client protocol, it may not be possible to continue with the protocol. If this makes certain actions unavailable to the user, the UI should inform the user about that in some way.
We should go through the relevant actions and decide on appropriate UX for each case.https://code.briarproject.org/briar/briar/-/issues/717Up navigation2020-11-21T16:38:01ZakwizgranUp navigationWe're currently treating the "up" action in the action bar as equivalent to the "back" action. Instead it should navigate to the current activity's parent.
https://developer.android.com/training/implementing-navigation/ancestral.htmlWe're currently treating the "up" action in the action bar as equivalent to the "back" action. Instead it should navigate to the current activity's parent.
https://developer.android.com/training/implementing-navigation/ancestral.htmlhttps://code.briarproject.org/briar/briar/-/issues/716Warn when entered text is too long2020-11-21T16:38:26ZakwizgranWarn when entered text is too longWe do this for forum posts, we should also do it for:
* Private messages
* Introduction messages
* Invitation messages
* Blog posts
* Blog commentsWe do this for forum posts, we should also do it for:
* Private messages
* Introduction messages
* Invitation messages
* Blog posts
* Blog commentshttps://code.briarproject.org/briar/briar/-/issues/711Improve encapsulation between ThreadItemAdapter and ThreadItemViewHolder2020-11-21T16:38:55ZTorsten GroteImprove encapsulation between ThreadItemAdapter and ThreadItemViewHolderAs discussed in [!350](https://code.briarproject.org/akwizgran/briar/merge_requests/350#note_13731), the new `ThreadItemAdapter` should need to be accessed so heavily in the `ThreadItemViewHolder` when it is bound to a view.As discussed in [!350](https://code.briarproject.org/akwizgran/briar/merge_requests/350#note_13731), the new `ThreadItemAdapter` should need to be accessed so heavily in the `ThreadItemViewHolder` when it is bound to a view.https://code.briarproject.org/briar/briar/-/issues/706Migrate crypto to libsodium2020-11-21T16:39:44ZakwizgranMigrate crypto to libsodiumUsing libsodium via JNI would give us constant-time implementations of Curve25519 and Ed25519 (see #236) and a fast implementation of Argon2 (see #170). Our crypto_secretbox implementation could be replaced, and we could use crypto_box i...Using libsodium via JNI would give us constant-time implementations of Curve25519 and Ed25519 (see #236) and a fast implementation of Argon2 (see #170). Our crypto_secretbox implementation could be replaced, and we could use crypto_box instead of ECIES for crash reports and feedback. BLAKE2s would remain in Java (libsodium only has BLAKE2b). If we replaced the Fortuna generator with libsodium's RNG, we could get rid of Bouncy Castle.
https://github.com/joshjdevl/libsodium-jnihttps://code.briarproject.org/briar/briar/-/issues/704Use constructor injection where possible2020-11-21T16:59:46ZakwizgranUse constructor injection where possibleClasses that don't require special constructors (pretty much everything except Activities, Fragments and Views) should use constructor injection rather than field injection. This allows us to make the fields final, so we don't have to wo...Classes that don't require special constructors (pretty much everything except Activities, Fragments and Views) should use constructor injection rather than field injection. This allows us to make the fields final, so we don't have to worry about whether they're been initialised or whether they should be volatile, and the class can be annotated @NotNullByDefault.https://code.briarproject.org/briar/briar/-/issues/702Improve encapsulation of ViewHolder classes2020-11-21T17:01:14ZakwizgranImprove encapsulation of ViewHolder classesEach BriarAdapter subclass has its own subclass of RecyclerView.ViewHolder. Some of these ViewHolder classes have public fields. Improve the encapsulation of these classes, either by adding accessor methods or by moving the code that acc...Each BriarAdapter subclass has its own subclass of RecyclerView.ViewHolder. Some of these ViewHolder classes have public fields. Improve the encapsulation of these classes, either by adding accessor methods or by moving the code that accesses the fields into the respective classes.https://code.briarproject.org/briar/briar/-/issues/699Bluetooth transport seems to block connections over other transports2020-11-21T17:01:42ZTorsten GroteBluetooth transport seems to block connections over other transportsI have no hard evidence for this claim, only anecdotal evidence. Mostly I noticed this when adding contacts. Even though both devices could connect just fine over the LAN, they wait until finally they manage to establish a Bluetooth conn...I have no hard evidence for this claim, only anecdotal evidence. Mostly I noticed this when adding contacts. Even though both devices could connect just fine over the LAN, they wait until finally they manage to establish a Bluetooth connection. So adding contacts takes quite some time (and can even fail).
Now, I noticed that when sending messages and devices are connected via Bluetooth, the messages are not sent until the Bluetooth connection can be established. So I just disabled Bluetooth one one device and got the messages delivered instantly over the LAN transport.https://code.briarproject.org/briar/briar/-/issues/691Password warnings are clipped2020-11-21T17:02:17ZakwizgranPassword warnings are clippedOn the Samsung Galaxy Ace 2 (Android 4.1.2, 480x800 screen) the warning messages shown during setup when the password is too weak or the passwords don't match are clipped at the right edge.
![device-2016-10-04-171244](/uploads/202d61695...On the Samsung Galaxy Ace 2 (Android 4.1.2, 480x800 screen) the warning messages shown during setup when the password is too weak or the passwords don't match are clipped at the right edge.
![device-2016-10-04-171244](/uploads/202d6169564994fbf6d28c022aa60fc8/device-2016-10-04-171244.png)
![device-2016-10-04-171311](/uploads/15c8896672c1ec2134529ed2b74278b6/device-2016-10-04-171311.png)