Skip to content

Commit 18c2f62

Browse files
committed
fix(cnf): scoped subscribe matches peer-COMMAND envelopes (p=target), not just messages (p=to)
v1 debt 019f1184-e244: send-cmd stores the recipient under p=target (msg-cli.clj:128), but the daemon's sub-match? only matched p=to — so a --scoped subscriber never got pushed peer-commands targeted at it, silently breaking the decentralized command path under scoped subscribe. Now matches {to,target}. Verified: cmd-to-me passes, cmd-to-other doesn't; 16/16 snapshot tests green.
1 parent f734605 commit 18c2f62

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cnf_coord_daemon.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@
373373
;; client re-scopes live on role/watch updates).
374374
(defn- sub-match? [flt {:keys [l p r]}]
375375
(or (nil? flt)
376-
(and (= p "to") (contains? (:addrs flt) r))
376+
;; a MESSAGE (send -> p"to") OR a peer-COMMAND envelope (send-cmd -> p"target")
377+
;; addressed to one of my addrs. "target" lands last in the envelope, so matching
378+
;; it is the trigger; the reactor then reads the full @cmd:<id>. (v1 debt 019f1184-e244)
379+
(and (#{"to" "target"} p) (contains? (:addrs flt) r))
377380
(contains? (:watch flt) l)
378381
(= l (:node flt))))
379382

0 commit comments

Comments
 (0)