dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

From some users messages come from a "deleted session"

Open PureTryOut opened this issue 1 year ago • 3 comments

Background information

  • Dendrite version or git SHA: 0.9.4
  • Monolith or Polylith?: Monolith
  • SQLite3 or Postgres?: postgreSQL
  • Running in Docker?: No
  • go version: 1.19
  • Client used (if applicable): Element web

Description

  • What is the problem: For some users Dendrite doesn't seem to know about all the devices in use by that user. Messages coming from that device are received by Dendrite and shown, but they are shown as coming from "a deleted session". Because Dendrite doesn't know about this device, messages send from Dendrite aren't decryptable by that device.
  • Who is affected: Random users from other homeservers participating in E2E chats with Dendrite users
  • How is this bug manifesting: In encrypted chats only
  • When did this first appear: Quite a while ago, I'd say a few months but I don't know a particular date, version or event

Steps to reproduce

I don't know what made this happen so I can't mention a full list of steps, but it's important to note that this only happens in encrypted (E2EE) chats.

PureTryOut avatar Aug 23 '22 20:08 PureTryOut

This seems to have been resolved since 0.9.7! After the upgrade it went syncing hard for a bit (CPU usage went up quite severely) and now the deleted session mentions are gone :tada:

PureTryOut avatar Sep 10 '22 15:09 PureTryOut

Aannnndddd this happened again. The fix worked for a day :sob:

PureTryOut avatar Sep 11 '22 13:09 PureTryOut

The latest commit actually partially fixed this for me. This commit fixes origin on device list updates and afterward, my matrix user device updates started to successfully update for my dendrite user. The old, previously deleted devices were still there so I went into the keyserver database and deleted device keys from keyserver_device_keys that had already been deleted but hadn't properly updated.

After doing this, I confirmed that the device keys were properly updating by performing a verification between the two users and their devices.

This still didn't resolve the intermittent "key was withheld" errors. I recreated that problem but then it fixed itself after recreating the chatroom. I couldn't reproduce it after that.

timaeos avatar Sep 16 '22 16:09 timaeos

Sadly it didn't for me. This issue still happens quite regularly, although I can temporarily fix the issue with the recently added refreshDevices endpoint. Now when people tell me they can't decrypt my messages I just run that endpoint against their account and it works for a while again till the device list gets out of sync again.

PureTryOut avatar Oct 13 '22 12:10 PureTryOut

Is this still happening? There have been quite a few fixes around E2EE and /members, which hopefully should have fixed the "deleted/unknown" session issue.

S7evinK avatar Nov 07 '22 11:11 S7evinK