on master help sign in
Fix bug #4: scope forkForwardsTo cleanup to (toKey, encryptedBlob), not blob alone

The post-success cleanup matched messages and other-pending-forwards by encryptedBlob only. If two recipients ever shared a blob (astronomically unlikely but not impossible), forwarding (A, X) would drop B's message and miscount pending forwards for B. Match on both toKey and encryptedBlob, mirroring the ACK path in doPoll.

commit32656163d9d4d36cd9f4cece2e9b60faca73cd62 authoriko <mail@iko.soy> dateFri 29 May 2026, 18:41 (4 months ago) parente6e5aa8
1 file changed+2−2
server.knot+2−2
server.knot+2−2
@@ -792,10 +792,10 @@ forkForwardsTo = \to encryptedBlob servers -> forEach servers (\server -> do
792792 *forwards = remaining
793793 pres <- *presence
794794 let stillLocal = hasLocalPresence pres to t
795− let othersPending = any (\x -> x.encryptedBlob == encryptedBlob) remaining
795+ let othersPending = any (\x -> x.toKey == to && x.encryptedBlob == encryptedBlob) remaining
796796 when (not (stillLocal || othersPending)) (do
797797 msgs <- *messages
798− *messages = filter (\m -> m.encryptedBlob != encryptedBlob) msgs)))
798+ *messages = filter (\m -> not (m.toKey == to && m.encryptedBlob == encryptedBlob)) msgs)))
799799
800800-- ============================================
801801-- Handler: federation receive