Closed ara4n closed 2 years ago
An additional point from our chat earlier - the hash will only be persisted on a per-session basis; the objective of this proposal is dramatically increase the accuracy of the reported figure, not to bring us to 100% accuracy.
The crypto team has been improving the quality of this metric over the last year: Closing in favour of that work.
We now have some basic reportage of UISI stats to matomo!! Yay! https://github.com/matrix-org/matrix-react-sdk/pull/1949
Whilst this gives us a very coarse value, it is going to overestimate failures perhaps to the point of being unusable, given the app may decrypt the same events multiple times (e.g. does this event fire when switching rooms?), and moreover if the decryption fails but is rapidly fixed (as happens quite often) then it'll still be reported as an error.
My suggestion is that we just shove these errors into a hash, deduplicated based on message ID, and removed if that message subsequently gets correctly decrypted. And then have a recurring timer which reads from the hash and looks at any failures older than 1 minute and reports them through to piwik.