Invisible Crypto: Web: display a warning when an *unverified* user changes identity
Followup to https://github.com/element-hq/element-meta/issues/2492. Part of https://github.com/element-hq/element-meta/issues/2491, itself part of Invisible crypto.
When an unverified user changes their identity, we need to make our user aware of this. In the long term, the intention is just to show a notice in the timeline (#2493); however, that is difficult to implement and we need a stop-gap.
This task is for Element Web.
The proposal is to show a warning above the composer, in much the same way as we would for verified users (#2491), but without locking the composer.
Figma designs:
- Web:
Implementation notes:
- ~~in matrix-sdk-crypto, we need to extend
UserIdentitiesto exposeidentity_needs_user_approval~~ not sure this is needed - [x] in matrix-sdk-crypto-wasm, extend
UserIdentityandOwnUserIdentityto exposeidentity_needs_user_approval- already done for
UserIdentityby https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm/pull/141. Don't think it's needed forOwnUserIdentity.
- already done for
- [x] in matrix-js-sdk, extend
RustCrypto.getUserVerificationStatusandUserVerificationStatusto includeidentityNeedsUserApproval- https://github.com/matrix-org/matrix-js-sdk/pull/4415
- [ ] in matrix-react-sdk, create a component which will:
- on start, call
Room.getEncryptionTargetMembersto get a list of users of interest, and then call getUserVerificationStatus on each, to build a list of users with pin violations - register callback for room membership updates; when we get one, check if the user is on the target encryption list, and check for pin violations (or remove from list if they have left)
- register callback for trust updates; when we get one:
- if the user is not in our list and there is a pin violation, check if they are on the target encryption list, and update the list if so
- if the user is on our list and there is not a pin violation, remove them immediately
- on start, call
It would be great if we can re-use the logic I am writing here https://github.com/matrix-org/matrix-rust-sdk/compare/main...andybalaam/room-identity-stream .
The core logic is inside the crypto crate, so there is some chance we can re-use it.
Is there a particular reason we want the banner to say "... appears to have changed" instead of simply "... has changed"? ( @mxandreas ?)
Is there a particular reason we want the banner to say "... appears to have changed" instead of simply "... has changed"?
Great question :) I was told that there is one, but I do not know what it exactly is. I also challenged it a while ago, and the response was that there had been a long debate on it already, thus I left it as there were more important topics. FWIW - I think it helps to distinguish between the pinned vs verified identity change, so supports debugging with users, etc.
Yeah, the wording is from https://github.com/matrix-org/matrix-spec-proposals/blob/andybalaam/crypto-terminology/proposals/4161-crypto-terminology.md#identity and it was crafted over quite a lot of time.
The point is that there are 2 possible cases:
- EITHER 1. the person is the same, and their cryptographic identity has changed,
- OR 2. the actual physical identity of the person is different - i.e. their account has been hijacked.
The wording is saying "it looks like 2 happened".
Make sense?
It would be great if we can re-use the logic I am writing here matrix-org/[email protected]/room-identity-stream .
The core logic is inside the crypto crate, so there is some chance we can re-use it.
For reference, this is also https://github.com/matrix-org/matrix-rust-sdk/pull/4022
If there are multiple users whose identity has changed, as a first cut, I'll just show one user at a time. It may be slightly annoying, but hopefully there won't be too many users that need acknowledging at a time.
If there are multiple users whose identity has changed, as a first cut, I'll just show one user at a time. It may be slightly annoying, but hopefully there won't be too many users that need acknowledging at a time.
Yes, that was the plan for now, also for EX.
For visibility: https://github.com/element-hq/element-meta/issues/2525#issuecomment-2394051527
@uhoreg Andy already mentioned but just in case - if you implement this, then please do it so that in clear rooms the banner is not shown: https://github.com/element-hq/element-meta/issues/2560
@uhoreg And another similar follow-up to me mentioned is https://github.com/element-hq/element-meta/issues/2565