Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message from a previously-verified user has a shield stating "Unknown error" #28170

Open
andybalaam opened this issue Oct 9, 2024 · 2 comments · May be fixed by #28476
Open

Message from a previously-verified user has a shield stating "Unknown error" #28170

andybalaam opened this issue Oct 9, 2024 · 2 comments · May be fixed by #28476
Assignees
Labels
A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@andybalaam
Copy link
Contributor

Steps to reproduce

  1. Two users who have verified each other using the emoji dance
  2. Reset identity of the sender
  3. To make sure, type /discardsession as the sender
  4. Send a message from the sender

Outcome

What did you expect?

I expected a shield saying "sent from a user in verification violation" (or better words)

What happened instead?

image

I saw "Unknown error" when hovered over the shield and the log said:

 Unknown shield state message 'Encrypted by a previously-verified user.'

Operating system

Debian 12.7

Browser information

Firefox 130.0

URL for webapp

https://develop.element.io

Application version

Element version: 8d77b2a-react-df4a223eb621-js-b842192a3415 Crypto version: Rust SDK 0.7.2 (517d99b), Vodozemac 0.7.0

Homeserver

No response

Will you send logs?

No

@dosubot dosubot bot added A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist labels Oct 9, 2024
@andybalaam
Copy link
Contributor Author

We ( @BillCarsonFr ) agreed to fix this without restructuring the code. We will make a new task to make this more maintainable in future.

@uhoreg
Copy link
Member

uhoreg commented Nov 11, 2024

Taking a quick look at this (I'm not self-assigning this because it's near the end of my day, but I may do so tomorrow if nobody else picks this up):

The icon seems to be determined in components/views/rooms/EventTile.tsx in the renderE2EPadlock function, and takes the tooltip from based on this.state.shieldReason, which is an EventShieldReason from matrix-js-sdk/src/crypto-api/index.ts, and gets set from rustEncryptionInfoToJsEncryptionInfo in matrix-js-sdk/src/rust-crypto/rust-crypto.ts. But it doesn't look like we have an EventShieldReason for verification violation yet. So we need to

  • add a new EventShieldReason code,
  • change rustEncryptionInfoToJsEncryptionInfo to emit that code,
  • get renderE2EPadlock to understand that code,
  • and add a new string for that code.

While we're in that area, we may also want to check what other codes we need to add. Also, given that we need to modify rustEncryptionInfoToJsEncryptionInfo already, we may want to convert it to using the shield state codes rather than the messages, as it shouldn't be much extra work, and will save us effort in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants