matrix-org / matrix-org/matrix-rust-sdk
Update message sender trust status when user's verification state improves
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
Follow up to https://github.com/matrix-org/matrix-rust-sdk/issues/3544
If a user is in verification violation and then they become verified OR we withdraw verification (making them unverified), update their sessions so messages from them have the updated status.
Current situation
- On Web, if you verify after being in verification violation, your new messages have no shield. (Also old messages, at least some of them.)
- On Element X, if you verify after being in verification violation, your new messages have no shield. (Your old ones keep the shield that they gained when you were in verification violation.)
So in both cases, new messages are displayed correctly. This story is to fix old messages.
This may already be fine on Web, in which case this story is just to fix Element X.
Implementation
-
Allow querying inbound group sessions by master key (remember to populate even for Unverified sessions)
- Add an indexed column on master key
- Populate it
- Allow querying based on it
-
Update SenderData when an identity becomes verified or verification is withdrawn.
- When /keys/query shows someone became verified recalculate all sessions for that master key with Unverified or PreviouslyVerified state
- When we withdraw verification recalculate all sessions for that master key with PreviouslyVerified state
-
Notify the UI code that the message needs updating (maybe by re-running decryption, or just by updating the shields)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with inbound group-session lookup and the /keys/query identity-update path described in the issue, then trace SenderData changes for verification and withdrawn verification. Check how the UI is notified when message state changes. Done means sessions for the affected master key are recalculated and old messages display the updated trust status.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100