mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 22:14:58 +08:00
Track decryption success/failure rate with piwik
Emit a piwik event when a decryption occurs in the category "E2E" with the action "Decryption result" and the name either "failure" or "success". NB: This will cause Riot to a lot of networking when decrypting many events. One HTTP request per decrypted event should be expected.
This commit is contained in:
parent
50e08c7560
commit
0934006817
@ -1308,6 +1308,15 @@ export default React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
// XXX: This will do a HTTP request for each Event.decrypted event
|
||||
cli.on("Event.decrypted", (e) => {
|
||||
if (e.isDecryptionFailure()) {
|
||||
Analytics.trackEvent('E2E', 'Decryption result', 'failure');
|
||||
} else {
|
||||
Analytics.trackEvent('E2E', 'Decryption result', 'success');
|
||||
}
|
||||
});
|
||||
|
||||
const krh = new KeyRequestHandler(cli);
|
||||
cli.on("crypto.roomKeyRequest", (req) => {
|
||||
krh.handleKeyRequest(req);
|
||||
|
Loading…
Reference in New Issue
Block a user