tchapgouv / tchap-web-v4

A Matrix web client for Tchap
https://www.tchap.gouv.fr/
Apache License 2.0
12 stars 4 forks source link

Can we have more info about why messages are undecrypted ? #904

Open estellecomment opened 5 months ago

estellecomment commented 5 months ago

Users don't know what to do when messages are undecrypted.

estellecomment commented 5 months ago

We can get more info in UI : click "..." > "Afficher la source"

Screen Shot 2024-02-13 at 11 38 04 AM

You can see : image

Screen Shot 2024-02-13 at 11 43 07 AM
estellecomment commented 5 months ago

You can see error codes thrown by js-sdk with DecryptionError : (there is no complete list, the string for errorcode is freeform) https://github.com/search?q=repo%3Amatrix-org%2Fmatrix-js-sdk+%22new+DecryptionError%28%22&type=code

estellecomment commented 5 months ago

You can search in console by eventId (identifiant de l'évenement) :

Error decrypting event (id=$NlBEAMosSpoC_NUXXXX type=m.room.encrypted sender=@XXXX:agent.dinum.tchap.gouv.fr room=!AhRwTGkjJegYVGSfaJ:agent.dinum.tchap.gouv.fr ts=2024-02-13T10:35:14.204Z): DecryptionError[msg: The sender's device has not sent us the keys for this message., session: knRj9pU2ww2SXXXX]

Which in the code corresponds to : MEGOLM_UNKNOWN_INBOUND_SESSION_ID

This is the case where I did not get keys when I logged in, because I skipped both Secure Storage connection and device emoji exchange.

estellecomment commented 5 months ago

Reproduce a slow sync (by throttling network) and see what error is displayed in "Afficher la source".

odelcroi commented 4 months ago

See also this ticket which investigate auto rageshake when unable to decrypt : #920

MarcWadai commented 3 weeks ago

New in matrix-react-sdk 3.101.0 :

MarcWadai commented 1 week ago

From element side :

Address UTDs - June Summary: A new source of UTD was discovered affecting Element-X android and fixed. Rageshake analysis showed some new occurrences of failure to establish olm sessions with federation when the remote federated server is having transient connectivity failures, MSC4081 could fix this problem by eagerly caching and serving fallback keys.

Investigation results New UTD cases (+ impact / effort to fix as of our dashboard) EX Android: events can be sent without an up-to-date member list causing UTDs (already fixed) Sliding Sync: dropping the database causes UTD Unsent messages (due to being too large) appear as UTDs: https://github.com/element-hq/element-web/issues/27656 - which is a variant of https://github.com/element-hq/element-web/issues/27334 - this appears as “unknown error” when breaking down by name in posthog. Delayed membership responses in /sync cause UTDs: https://github.com/matrix-org/matrix-rust-sdk/issues/3622 and https://github.com/matrix-org/matrix-js-sdk/issues/4291 - this will impact bots and DMs, anything which instantly does invite->send_message, exacerbated on JS SDK. Unable to decrypt message, keys aren't getting transferred from other devices: https://github.com/element-hq/element-web/issues/27623 - we see various forms of gossiping not exchanging all keys, see https://github.com/element-hq/element-web/issues/27655 for a similar (code agrees with itself for this though) failure mode for the self-signing key. Confusion over not sending to unverified devices causing UTDs: https://github.com/element-hq/element-meta/issues/2450 - Seen at least 1 user who got a UTD because the sender refused to send to unverified devices (on EA). Message previews in the room list can erroneously show UTDs: https://github.com/element-hq/element-web/issues/27579 and https://github.com/element-hq/element-x-ios/issues/2977 - same bug independently done? Rageshakes: https://github.com/element-hq/synapse/issues/17267 has been seen twice, and MSC4081 could fix it.