element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
Apache License 2.0
392 stars 86 forks source link

Historic messages decrypt on cache reloading, but not before #3055

Open wrjlewis opened 1 month ago

wrjlewis commented 1 month ago

Steps to reproduce

Sign into a new instance of Element X Verify your device Open some chats with historic E2EE message, those messages can appear as UTDs Clear EX cache in developer settings All historic messages are now decrypted properly

Outcome

What did you expect?

Historic messages decrypt successfully, and are displayed as such, without having to cache reload.

What happened instead?

Historic messages that are shown as UTDs in the timeline seem stuck that way indefinitely. It could be that the keys are being downloaded or processed at the same time as a user trying to open the message, EX is unable to show the message and presents it as a UTD, and subsequently doesn't attempt to decrypt the message again in future.

Your phone model

iPhone 12 pro

Operating system version

MacOS and iOS

Application version

1.6.13

Homeserver

Synapse

Will you send logs?

No

pixlwave commented 1 month ago

This sounds like it might be similar to #3045 but viewed from a different perspective.

wrjlewis commented 1 month ago

This sounds like it might be similar to #3045 but viewed from a different perspective.

Yup sounds similar - ie EX caching the fact it's not immediately been able to decrypt the event

ara4n commented 1 month ago

Getting similar on EXA too: https://github.com/element-hq/element-x-android/issues/3234

richvdh commented 1 month ago

Since this seems common to EXI and EXA, and likely a problem in the rust layer, I have pulled out a common issue to track fixing this in the rust layer: https://github.com/matrix-org/matrix-rust-sdk/issues/3768

wrjlewis commented 2 weeks ago

Still seeing this, as are others I know running EX, consistently. @neilisfragile ran into this on Friday on switchover to SSS which forces a logout / login.

richvdh commented 2 weeks ago

Please do send rageshakes for any observed UTDs. Our decisions for which UTD causes get fixed are pretty directly based on the number of rageshakes we see for those causes.

neilisfragile commented 2 weeks ago

Here is a rageshake, though I (and I think anyone) can consistently reproduce. https://github.com/element-hq/element-x-ios-rageshakes/issues/2088

ara4n commented 3 days ago

i wonder if this is the same as https://github.com/element-hq/element-x-ios/issues/2417.

It might also be happening on EXA in https://github.com/element-hq/element-x-android/issues/3382

thibaultamartin commented 1 day ago

Happening to me as well on Element X nightly, after turning "Force Native Sync" and logging out and back in. The suggested workaround to clear the cache fixes things. Happy to test again once there is a fix in EX