From ed7cf375ad8265d56cb8bcc81fe6f6f4aaca9a8e Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 3 May 2019 11:20:12 +0100 Subject: [PATCH] Only remove an entry from specs when no holders remain --- syndicate/broker/federation2.rkt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syndicate/broker/federation2.rkt b/syndicate/broker/federation2.rkt index f00f12c..6452a19 100644 --- a/syndicate/broker/federation2.rkt +++ b/syndicate/broker/federation2.rkt @@ -93,10 +93,10 @@ localid connid (lambda (sub) (define new-holders (hash-remove (subscription-holders sub) connid)) - (specs (hash-remove (specs) (subscription-spec sub))) - (subs (if (hash-empty? new-holders) - (hash-remove (subs) localid) - (hash-set (subs) localid (struct-copy subscription sub + (if (hash-empty? new-holders) + (begin (specs (hash-remove (specs) (subscription-spec sub))) + (subs (hash-remove (subs) localid))) + (subs (hash-set (subs) localid (struct-copy subscription sub [holders new-holders])))) ;; The messages we send depend on (hash-count new-holders):