gall: handle %kicks for nonexistent subscriptions

This commit is contained in:
yosoyubik 2022-04-15 17:22:01 +02:00
parent a288d455c3
commit 3f7f4dbd5a
2 changed files with 13 additions and 2 deletions

View File

@ -2504,7 +2504,6 @@
(on-hear [message-num fragment-num=p.ack-meat]:task)
::
%|
~& [current.state message+message-num:task]
=/ cork=?
=/ top-live
(pry:packet-queue:*make-packet-pump live.packet-pump-state.state)

View File

@ -1493,9 +1493,13 @@
::
?: =(~ agent-wire)
on-missing
=/ has-nonce=(unit @ud) (slaw %ud (head agent-wire))
?: &(?=(~ has-nonce) ?=(%kick -.sign))
on-weird-kick
:: pop nonce off .agent-wire and match against stored subscription
::
=: nonce (slav %ud (head agent-wire))
?> ?=(^ has-nonce)
=: nonce u.has-nonce
agent-wire (tail agent-wire)
==
=/ got (~(get by outbound.watches.yoke) sub-key)
@ -1552,6 +1556,14 @@
>wire=wire<
==
::
++ on-weird-kick
%. run-sign
%- slog :~
leaf+"{<agent-name>}: got %kick for nonexistent subscription"
leaf+"{<dock>}: {<agent-wire>}"
>wire=wire<
==
::
++ on-bad-nonce
|= stored-nonce=@
%. ap-core