ames: correctly %lose a %boon we crashed on

Previously, if we noticed %boon handling had caused a crash, we would
transform any existing %boons into %losts, but still emit a new %boon
for the message we ostensibly crashed on.

Now, we make sure to just directly send a %lost if sending the %boon
caused a crash. We drop the existing-moves transformation entirely,
assuming it to vestigial.
This commit is contained in:
fang 2023-05-23 22:10:17 +02:00 committed by GitHub
parent 2f16a3b1b1
commit d8e11b68c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4018,15 +4018,13 @@
::
=/ dat [her bone=bone message-num=message-num]
?:(ok "sink boon {<dat>}" "crashed on sink boon {<dat>}")
=? moves !ok
:: we previously crashed on this message; notify client vane
::
%+ turn moves
|= =move
?. ?=([* %give %boon *] move) move
[duct.move %give %lost ~]
:: if we previously crashed on this message;
:: notify client vane instead of making it try again
::
=. peer-core (pe-emit (got-duct bone) %give %boon message)
=. peer-core
%+ pe-emit (got-duct bone)
?. ok [%give %lost ~]
[%give %boon message]
:: send ack unconditionally
::
(call %done ok=%.y)