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 for images sometimes being sent unencrypted in an encrypted room. #5567

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

pixlwave
Copy link
Member

Following on from matrix-org/matrix-ios-sdk#1358 it is possible in 1.8.0 TF for the query to a room's encryption algorithm to occur before that algorithm has been stored in the realm when sending an image. When sending a text message the algorithm gets stored when shareEncryptionKeys is called before a typing notification is created.

This PR mimics the same behaviour by calling shareEncryptionKeys when the composer's action menu is displayed as none of those events send typing notifications. That said, I think some deeper thought needs to go into the timing of all of this if we are going to rely on using the realm for encryption status.

@pixlwave pixlwave linked an issue Feb 11, 2022 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Feb 11, 2022

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/Q4ovJW

@pixlwave pixlwave force-pushed the doug/5564_unencrypted_images branch from 95769f6 to 7d2067e Compare February 11, 2022 18:57
@pixlwave pixlwave force-pushed the doug/5564_unencrypted_images branch from 7d2067e to cb57f5e Compare February 11, 2022 19:00
@pixlwave pixlwave changed the base branch from develop to hotfix/1.8.0 February 11, 2022 19:01
The logic around when to send a typing notification also includes logic around when to exchange encryption keys.
handleTypingNotification renamed to handleTypingState for clarity.
@pixlwave
Copy link
Member Author

The new commit refines the no-op in a thread view to only apply to the sending of the notification. This way shareEncryptionKeys will still be called (and with the same frequency as in a room).

@pixlwave pixlwave merged commit 3f2fde4 into hotfix/1.8.0 Feb 15, 2022
@pixlwave pixlwave deleted the doug/5564_unencrypted_images branch February 15, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image sent to encrypted room was not encrypted
1 participant