SchildiChat / schildichat-desktop

Matrix client / Element Web/Desktop fork
https://schildi.chat
Apache License 2.0
371 stars 42 forks source link

Issues with sending messages and requesting encryption keys #167

Closed NathanC closed 1 year ago

NathanC commented 1 year ago

I'm kind of lost here, I'm seeing some strange behavior with encryption in DMs. I recently switched to a more secure environment, and decided to rotate my cross-signing keys, and since then things have been strange. After some tinkering, I decided to reset my master backup and do a full reset of keys ("delete everything") on Mobile. I still see my message history on mobile, albiet with an "encrypted by an unverified device" message.

Now, for the problem:

When I log into SchildeChat on desktop or web, and verify my session using SchildeChat mobile, I still can't see old messages in DMs (even though I'm able to see them in the DM in my phone's history). When I click "re-request encryption keys", nothing seems to happen. If I send a message from desktop SchildeChat (but not from web), it shows a red shield next to the message, and when I hover over it it shows some cryptic URL (that starts with matrix.to). And, strangly, if I click the shield, the message dissapears and it says "can't load this message (m.room.message)", even though all my other devices are able to see the message.

This seems specific to SchildeChat. I just logged into Element Web (new private browser, never used Element there before), and it has all my old messages, presumably from keys shared by SchildeChat on my phone from a request Element made. It says "encrypted by a deleted session", which makes sense seeing how I reset all my keys.

It seems like I may have gotten into some inconsistent state, or SchildeChat isn't dealing with some edge condition here? How can I debug further to help figure out what this is, or is there something here I'm missing?

NathanC commented 1 year ago

Okay, so I exported my e2e keys from Element (keep in mind element presumably got those from SchildeChat android as that was my only active session when I logged into Element), loaded the keys into SchildeChat desktop, and all my old messages are visible.

However, I just logged out of ShildeChat desktop again and logged back in, and the same problem is present again. Old messages can't be decrypted, and key requests don't seem to do anything, despite verification (and schildechat android and element web sessions being active).

It seems like this is an issue with schildechat requesting old keys, unless I'm missing something? Element was able to request them successfully.

edit to add some more data: I logged into element web (and saw all my old messages), and logged out of every other session besides my unencrypted/unverified bridge accounts. I deleted the android app and desktop app entirely. I then redownloaded the schildechat android app, and verified using Element Web-- it worked well! All my old messages were there, and showed grey shield. Then I downloaded schildechat desktop again, logged in and verified using the android app, and I can't see old messages or re-request keys.

It's really bad though-- this isn't just applying to really old messages from before I rotated my keys, schildechat desktop isn't able to see messages I sent 5 minutes ago from Android even after I log in and verify.

NathanC commented 1 year ago

Just tested with the new desktop client release, and the issue is no longer present. Now that I've learned how to use the dev tools, I'll make sure to include relevant debugging research if I file any more bugs.

su-ex commented 1 year ago

Duplicate of https://github.com/SchildiChat/schildichat-desktop/issues/151

This was just a visual bug with the bubble layout.