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

Fix the warning for messages from unsigned devices #3743

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Sep 20, 2023

#3693 attempted to port the logic for event shields from react-sdk to js-sdk, but I seem to have messed up this case.

I've double checked all the logic and... it's hopefully right this time.


Here's what your changelog entry will look like:

🐛 Bug Fixes

  • Fix the warning for messages from unsigned devices (#3743).

@richvdh richvdh requested a review from a team as a code owner September 20, 2023 16:56
@@ -2738,6 +2738,8 @@ export class Crypto extends TypedEventEmitter<CryptoEvent, CryptoEventHandlerMap
const senderId = event.getSender();
if (!senderId || encryptionInfo.mismatchedSender) {
// something definitely wrong is going on here

// previously: E2EState.Warning -> E2ePadlockUnverified -> Red/"Encrypted by an unverified session"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these "previously" comments relate to the old logic in EventTile (https://github.com/matrix-org/matrix-react-sdk/blob/v3.80.1/src/components/views/rooms/EventTile.tsx#L579-L637). I found them useful for double-checking the logic.

@@ -1649,6 +1649,7 @@ function rustEncryptionInfoToJsEncryptionInfo(
if (shieldState.message === null) {
shieldReason = null;
} else if (shieldState.message === "Encrypted by an unverified user.") {
// this case isn't actually used with lax shield semantics.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated, but something I came across while I was figuring out what happened and it doesn't feel like worth making a separate PR for

@richvdh richvdh changed the title Fix the message for messages from unknown devices Fix the message for messages from unsigned devices Sep 20, 2023
@richvdh richvdh changed the title Fix the message for messages from unsigned devices Fix the warning for messages from unsigned devices Sep 20, 2023
@richvdh richvdh added this pull request to the merge queue Sep 21, 2023
Merged via the queue into develop with commit f134d6d Sep 21, 2023
32 of 33 checks passed
@richvdh richvdh deleted the rav/element-r/fix_unsigned_device_shield branch September 21, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants