fix: Automatically remove corrupted appservice registrations

This commit is contained in:
timedout 2026-01-05 18:47:56 +00:00 committed by Jade Ellis
parent ce46b6869f
commit 3992071980
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -272,7 +272,10 @@ impl Service {
.get(id)
.await
.and_then(|ref bytes| serde_saphyr::from_slice(bytes).map_err(Into::into))
.map_err(|e| err!(Database("Invalid appservice {id:?} registration: {e:?}")))
.map_err(|e| {
self.db.id_appserviceregistrations.remove(id);
err!(Database("Invalid appservice {id:?} registration: {e:?}. Removed."))
})
}
pub fn read(&self) -> impl Future<Output = RwLockReadGuard<'_, Registrations>> + Send {