Element-R: Report events with withheld keys separately to Posthog. (#12755)
* Remove refs to deprecated method `MatrixEvent.isEncryptedDisabledForUnverifiedDevices` is now deprecated * Report new posthog code for withheld message keys
This commit is contained in:
committed by
GitHub
parent
c894bebaa0
commit
19f9f98564
@@ -78,7 +78,10 @@ export class DecryptionFailureTracker {
|
||||
// Map JS-SDK error codes to tracker codes for aggregation
|
||||
switch (errorCode) {
|
||||
case DecryptionFailureCode.MEGOLM_UNKNOWN_INBOUND_SESSION_ID:
|
||||
case DecryptionFailureCode.MEGOLM_KEY_WITHHELD:
|
||||
return "OlmKeysNotSentError";
|
||||
case DecryptionFailureCode.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE:
|
||||
return "RoomKeysWithheldForUnverifiedDevice";
|
||||
case DecryptionFailureCode.OLM_UNKNOWN_MESSAGE_INDEX:
|
||||
return "OlmIndexError";
|
||||
case DecryptionFailureCode.HISTORICAL_MESSAGE_NO_KEY_BACKUP:
|
||||
|
||||
@@ -23,8 +23,10 @@ import { IBodyProps } from "./IBodyProps";
|
||||
import { LocalDeviceVerificationStateContext } from "../../../contexts/LocalDeviceVerificationStateContext";
|
||||
|
||||
function getErrorMessage(mxEvent: MatrixEvent, isVerified: boolean | undefined): string {
|
||||
if (mxEvent.isEncryptedDisabledForUnverifiedDevices) return _t("timeline|decryption_failure|blocked");
|
||||
switch (mxEvent.decryptionFailureReason) {
|
||||
case DecryptionFailureCode.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE:
|
||||
return _t("timeline|decryption_failure|blocked");
|
||||
|
||||
case DecryptionFailureCode.HISTORICAL_MESSAGE_NO_KEY_BACKUP:
|
||||
return _t("timeline|decryption_failure|historical_event_no_key_backup");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user