From 77377df19a74431c4de0e0802406cb8ebebe2ab6 Mon Sep 17 00:00:00 2001 From: dav12072018 <45704737+dav12072018@users.noreply.github.com> Date: Sat, 16 May 2026 10:02:21 -0700 Subject: [PATCH] Broaden MP cache-invalidate to all messageprotection-* codes Previously only "ec-com.apple.messageprotection-802" triggered identity cache invalidation on a command:120 error. The same recovery path (invalidating the cached per-device session keys for the failing pair) also resolves "-6" (signature/decrypt verification failed on the recipient device) and other recoverable message-protection codes that indicate a stale per-device session key. Without this, MP-6 errors propagate to the UI as send failures even when Apple's IDS already accepted and delivered the message to the chat recipient. This is particularly visible for self-loop errors (sP == tP) where the user's own other devices reject the reflected copy: the chat recipient sees the message, but the sender's OpenBubbles UI marks it failed and never recovers because the stale cached session keeps producing the same failure on retry. Refs: openbubbles-app#206 --- src/imessage/aps_client.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/imessage/aps_client.rs b/src/imessage/aps_client.rs index 5d952aa..8e14e15 100644 --- a/src/imessage/aps_client.rs +++ b/src/imessage/aps_client.rs @@ -250,8 +250,12 @@ impl IMClient { target: Some(target), .. } = &payload { - if error_string == "ec-com.apple.messageprotection-802" { - // refreshing identity cache can fix this + if error_string.starts_with("ec-com.apple.messageprotection-") { + // refreshing identity cache can fix this; previously this only + // matched "-802" but the same recovery path also resolves "-6" + // (signature/decrypt verification failed) and other recoverable + // message-protection codes that indicate a stale per-device + // session key. See discussion in openbubbles-app#206. let mut cache_lock = self.identity.cache.lock().await; cache_lock.invalidate(&target, &sender); }