mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-07 07:30:23 +03:00
ames: handle misordered crashing boons
Two bugs fixed here: first, if the %done reentrancy triggered another %boon, that wasn't getting translated to a %lost, even though it could have been the reason the event crashed in the first place. Second, the %done reentrancy needs to happen after we emit our move, so that we don't invert the order of the %boon's we produce.
This commit is contained in:
parent
a64e516fc5
commit
7ca3d9624e
@ -2217,17 +2217,29 @@
|
|||||||
^+ peer-core
|
^+ peer-core
|
||||||
:: send ack unconditionally
|
:: send ack unconditionally
|
||||||
::
|
::
|
||||||
|
=. peer-core (emit (got-duct bone) %give %boon message)
|
||||||
=. peer-core (run-message-sink bone %done ok=%.y)
|
=. peer-core (run-message-sink bone %done ok=%.y)
|
||||||
::
|
::
|
||||||
?. ?=([%hear * * ok=%.n] task)
|
?. ?=([%hear * * ok=%.n] task)
|
||||||
:: fresh boon; give message to client vane
|
:: fresh boon; give message to client vane
|
||||||
::
|
::
|
||||||
%- (trace msg.veb |.("boon {<her.channel^bone>}"))
|
%- (trace msg.veb |.("boon {<her.channel^bone -.task>}"))
|
||||||
(emit (got-duct bone) %give %boon message)
|
peer-core
|
||||||
:: we previously crashed on this message; notify client vane
|
:: we previously crashed on this message; notify client vane
|
||||||
::
|
::
|
||||||
%- (trace msg.veb |.("crashed on boon {<her.channel^bone>}"))
|
%- (trace msg.veb |.("crashed on boon {<her.channel^bone -.task>}"))
|
||||||
(emit (got-duct bone) %give %lost ~)
|
boon-to-lost
|
||||||
|
:: +boon-to-lost: convert all boons to losts
|
||||||
|
::
|
||||||
|
++ boon-to-lost
|
||||||
|
^+ peer-core
|
||||||
|
=. moves
|
||||||
|
%+ turn moves
|
||||||
|
|= =move
|
||||||
|
?. ?=([* %give %boon *] move)
|
||||||
|
move
|
||||||
|
[duct.move %give %lost ~]
|
||||||
|
peer-core
|
||||||
:: +on-sink-nack-trace: handle nack-trace received by |message-sink
|
:: +on-sink-nack-trace: handle nack-trace received by |message-sink
|
||||||
::
|
::
|
||||||
++ on-sink-nack-trace
|
++ on-sink-nack-trace
|
||||||
|
@ -205,7 +205,7 @@
|
|||||||
::
|
::
|
||||||
%+ expect-eq
|
%+ expect-eq
|
||||||
!> [~[/g/talk] %give %boon [%post 'first1!!']]
|
!> [~[/g/talk] %give %boon [%post 'first1!!']]
|
||||||
!> (snag 1 `(list move:ames)`moves6)
|
!> (snag 0 `(list move:ames)`moves6)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ test-nack ^- tang
|
++ test-nack ^- tang
|
||||||
|
Loading…
Reference in New Issue
Block a user