feat(crypto): Support new expected UTD causes UX + Analytics
This commit is contained in:
parent
64317523d1
commit
149cb14916
6 changed files with 54 additions and 1 deletions
|
|
@ -40,6 +40,15 @@ fun TimelineItemEncryptedView(
|
||||||
UtdCause.UnknownDevice -> {
|
UtdCause.UnknownDevice -> {
|
||||||
CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block
|
CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block
|
||||||
}
|
}
|
||||||
|
UtdCause.HistoricalMessage -> {
|
||||||
|
CommonStrings.timeline_decryption_failure_historical_event_no_key_backup to CompoundDrawables.ic_compound_block
|
||||||
|
}
|
||||||
|
UtdCause.WithheldUnverifiedOrInsecureDevice -> {
|
||||||
|
CommonStrings.timeline_decryption_failure_withheld_unverified to CompoundDrawables.ic_compound_block
|
||||||
|
}
|
||||||
|
UtdCause.WithheldBySender -> {
|
||||||
|
CommonStrings.timeline_decryption_failure_unable_to_decrypt to CompoundDrawables.ic_compound_error
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time
|
CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,24 @@ open class TimelineItemEncryptedContentProvider : PreviewParameterProvider<Timel
|
||||||
utdCause = UtdCause.UnsignedDevice,
|
utdCause = UtdCause.UnsignedDevice,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
aTimelineItemEncryptedContent(
|
||||||
|
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||||
|
sessionId = "sessionId",
|
||||||
|
utdCause = UtdCause.HistoricalMessage,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
aTimelineItemEncryptedContent(
|
||||||
|
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||||
|
sessionId = "sessionId",
|
||||||
|
utdCause = UtdCause.WithheldUnverifiedOrInsecureDevice,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
aTimelineItemEncryptedContent(
|
||||||
|
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||||
|
sessionId = "sessionId",
|
||||||
|
utdCause = UtdCause.WithheldBySender,
|
||||||
|
)
|
||||||
|
),
|
||||||
aTimelineItemEncryptedContent(
|
aTimelineItemEncryptedContent(
|
||||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||||
sessionId = "sessionId",
|
sessionId = "sessionId",
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,22 @@ enum class UtdCause {
|
||||||
SentBeforeWeJoined,
|
SentBeforeWeJoined,
|
||||||
VerificationViolation,
|
VerificationViolation,
|
||||||
UnsignedDevice,
|
UnsignedDevice,
|
||||||
UnknownDevice
|
UnknownDevice,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expected utd because this is a device-historical message and
|
||||||
|
* key storage is not setup or not configured correctly.
|
||||||
|
*/
|
||||||
|
HistoricalMessage,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The key was withheld on purpose because your device is insecure and/or the
|
||||||
|
* sender trust requirement settings are not met for your device
|
||||||
|
*/
|
||||||
|
WithheldUnverifiedOrInsecureDevice,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key is withheld by sender
|
||||||
|
*/
|
||||||
|
WithheldBySender,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ class UtdTracker(
|
||||||
UtdCause.UNKNOWN_DEVICE -> {
|
UtdCause.UNKNOWN_DEVICE -> {
|
||||||
Error.Name.ExpectedSentByInsecureDevice
|
Error.Name.ExpectedSentByInsecureDevice
|
||||||
}
|
}
|
||||||
|
UtdCause.HISTORICAL_MESSAGE -> Error.Name.HistoricalMessage
|
||||||
|
UtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> Error.Name.RoomKeysWithheldForUnverifiedDevice
|
||||||
|
UtdCause.WITHHELD_BY_SENDER -> Error.Name.OlmKeysNotSentError
|
||||||
}
|
}
|
||||||
val event = Error(
|
val event = Error(
|
||||||
context = null,
|
context = null,
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,9 @@ private fun RustUtdCause.map(): UtdCause {
|
||||||
RustUtdCause.VERIFICATION_VIOLATION -> UtdCause.VerificationViolation
|
RustUtdCause.VERIFICATION_VIOLATION -> UtdCause.VerificationViolation
|
||||||
RustUtdCause.UNSIGNED_DEVICE -> UtdCause.UnsignedDevice
|
RustUtdCause.UNSIGNED_DEVICE -> UtdCause.UnsignedDevice
|
||||||
RustUtdCause.UNKNOWN_DEVICE -> UtdCause.UnknownDevice
|
RustUtdCause.UNKNOWN_DEVICE -> UtdCause.UnknownDevice
|
||||||
|
RustUtdCause.HISTORICAL_MESSAGE -> UtdCause.HistoricalMessage
|
||||||
|
RustUtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> UtdCause.WithheldUnverifiedOrInsecureDevice
|
||||||
|
RustUtdCause.WITHHELD_BY_SENDER -> UtdCause.WithheldBySender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -365,4 +365,7 @@ Reason: %1$s."</string>
|
||||||
<string name="settings_version_number">"Version: %1$s (%2$s)"</string>
|
<string name="settings_version_number">"Version: %1$s (%2$s)"</string>
|
||||||
<string name="test_language_identifier">"en"</string>
|
<string name="test_language_identifier">"en"</string>
|
||||||
<string name="test_untranslated_default_language_identifier">"en"</string>
|
<string name="test_untranslated_default_language_identifier">"en"</string>
|
||||||
|
<string name="timeline_decryption_failure_historical_event_no_key_backup">"Historical messages are not available on this device"</string>
|
||||||
|
<string name="timeline_decryption_failure_unable_to_decrypt">"Unable to decrypt message"</string>
|
||||||
|
<string name="timeline_decryption_failure_withheld_unverified">"This message was blocked either because your device is unverified or because the sender needs to verify your identity."</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue