Remove verification listeners of logged out sessions

- Clear the listener when RustSessionVerificationService is destroyed.
- IncomingVerificationRequestObserver removes the listener of the clients which are not in the MatrixSessionCache anymore.
- Remove the sessions from the MatrixSessionCache when they are removed from the SessionStore (logout, account deactivation).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benoit Marty
2026-10-01 18:18:19 +02:00
parent ee65fb99ae
commit d68e92a4f0
4 changed files with 47 additions and 2 deletions
@@ -245,6 +245,7 @@ class RustSessionVerificationService(
fun destroy() {
Timber.d("Destroying RustSessionVerificationService")
listener = null
verificationStateListenerTaskHandle.cancelAndDestroy()
recoveryStateListenerTaskHandle.cancelAndDestroy()
if (this::verificationController.isInitialized) {