Bug 494094

Summary: Previous encrypted messages are not decrypted if they were written in other client before verifying NeoChat
Product: [Applications] NeoChat Reporter: Igor Mironchik <igor.mironchik>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: normal CC: carl
Priority: NOR    
Version First Reported In: 24.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Room settings in Element

Description Igor Mironchik 2024-10-04 09:06:21 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
Previous encrypted messages are not decrypted if they were written in other client before verifying NeoChat


STEPS TO REPRODUCE
1. Create encrypted room with somebody in any Matrix client before any NeoChat verifications
2. Type there messages
3. Install NeoChat and verify your devices

OBSERVED RESULT
I see all my rooms, but messages in them are encrypted and I see a text on each message: "This message is encrypted and the sender has not shared the key with this device." But, to be honest, new messages are seen on all devices.


EXPECTED RESULT
Messages should be decrypted and seen in NeoChat when device is verified.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: KDE neon 6.0
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Tobias Fella 2024-10-04 09:08:59 UTC
Did you activate the "Never send encrypted messages to unverified sessions from this session" checkbox in element? if you do that, it won't send encryption keys to unverified sessions
Comment 2 Igor Mironchik 2024-10-04 09:35:14 UTC
Created attachment 174398 [details]
Room settings in Element
Comment 3 Igor Mironchik 2024-10-04 09:35:59 UTC
(In reply to Tobias Fella from comment #1)
> Did you activate the "Never send encrypted messages to unverified sessions
> from this session" checkbox in element? if you do that, it won't send
> encryption keys to unverified sessions

No, this option is turned off, look screenshot.
Comment 4 Tobias Fella 2024-10-10 14:20:37 UTC
NeoChat doesn't care whether it is verified or not. If messages can't be decrypted because neochat is unverified, that must be due to the sending device. That being said, my inital question was, of course, misguided: What matters is whether the sender's client is configured to only send encryption keys to verified devices, not yours. 

Your problem seems to be about messages that were sent before neochat was even logged in; decrypting those will be possible with the next release of libquotient, which is coming very soon.