fix(core): tear down shares on forget/block and fail-closed blocks

Cancel targeted protocol shares synchronously before await, and treat block
lookup errors as denied so store failures cannot admit blocked peers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-11 03:35:18 +02:00
parent 22c842acb1
commit e2cfad7fb3
6 changed files with 36 additions and 12 deletions

View File

@@ -129,10 +129,11 @@ impl DeviceRelationshipService {
}
pub(super) async fn is_blocked(&self, endpoint_id: &str) -> bool {
// Fail closed: a store error must not admit blocked traffic.
self.contacts()
.is_blocked(endpoint_id)
.await
.unwrap_or(false)
.unwrap_or(true)
}
/// Drop orphaned relationship grant secrets and disable rows whose secrets are gone.