Add more encryption properties to PostHog (#12415)

* report time to decrypt an event if it's slow

* add more stats

* fix some tests

* keep original timestamp, and report non-visible decryption failures

* add statistic for whether the user trusts their own device

* revert local playwright docker changes

* apply changes from review

* also remove logout event handler on logout

* apply changes from review

* make eventDecrypted callback private
This commit is contained in:
Hubert Chathi 2024-05-15 20:25:58 -04:00 committed by GitHub
parent 0c04ec1def
commit eed8d1538b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 626 additions and 180 deletions

View file

@ -21,7 +21,6 @@ import {
EventType,
HttpApiEvent,
MatrixClient,
MatrixEventEvent,
MatrixEvent,
RoomType,
SyncStateData,
@ -1592,11 +1591,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
// tracked events across sessions.
// dft.loadTrackedEventHashMap();
dft.start();
// When logging out, stop tracking failures and destroy state
cli.on(HttpApiEvent.SessionLoggedOut, () => dft.stop());
cli.on(MatrixEventEvent.Decrypted, (e) => dft.eventDecrypted(e));
dft.start(cli);
cli.on(ClientEvent.Room, (room) => {
if (cli.isCryptoEnabled()) {