Hi there, Signal-Android developer here. I updated the issue to reflect this, but this bug has been fixed. I was tracking it on a separate issue, and had forgotten to close this one. We do, in fact, take issues like this very seriously. This bug was extraordinarily rare, and because we have no metrics/remote log collection, there was an initial period where we had to spend time adding logging and collecting user-subm…
I appreciate that this was a difficult and rare bug, but for an app that sells itself as 'secure', it feels like this isn't acceptable. How can users be assured that this type of issue won't occur again?
By writing code defensively. Despite the other comments, it's possible.
The key is to be redundant: for example, off-by-one errors are very common when accessing an set of indexed items by number.
Yet you can split the set (e.g. an array) in multiple ones to make it more unlikely that you pick the wrong item (e.g. picture vs users).
You can also "tag" the outgoing image with some attributes, e.g. the recipient and a sent/not-sent flag.
You can cross-check and stop if something is inconsistent. Many other things are possible e.g. to protect from RAM bit flips.
It's not a matter of language or tooling, it's a matter of mindset.