mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-01 02:45:49 +03:00
contacts: fix %kick handling
And, crucially, re-establish subscriptions in the cases that got broken by the poor %kick handling. These are cases where we think %chi (subscription established), but there is no matching subscription to be found in the bowl. Fixes LAND-1407, or at least its common cause.
This commit is contained in:
parent
f34d17cf56
commit
bc00efd341
@ -115,6 +115,7 @@
|
||||
++ abet [(flop out) state]
|
||||
++ cor .
|
||||
++ emit |=(c=card cor(out [c out]))
|
||||
++ emil |=(c=(list card) cor(out (weld (flop c) out)))
|
||||
++ give |=(=gift:agent:gall (emit %give gift))
|
||||
++ pass |=([=wire =note:agent:gall] (emit %pass wire note))
|
||||
::
|
||||
@ -244,7 +245,7 @@
|
||||
%- (slog 'contact-fail' u.p.sign)
|
||||
pe-peer:si-epic(sag %fail)
|
||||
::
|
||||
%kick si-heed
|
||||
%kick si-heed(sag ~)
|
||||
::
|
||||
:: [compat] we *should* maintain backcompat here
|
||||
::
|
||||
@ -402,10 +403,23 @@
|
||||
|= old-vase=vase
|
||||
^+ cor
|
||||
|^ =+ !<([old=versioned-state cool=epic] old-vase)
|
||||
=. state
|
||||
?- -.old
|
||||
%0 old
|
||||
==
|
||||
:: if there should be a sub (%chi saga), but there is none (in the
|
||||
:: bowl), re-establish it. %kick handling used to be faulty.
|
||||
:: we run this "repair" on every load, in the spirit of +inflate-io.
|
||||
::
|
||||
=^ cards rol.old
|
||||
%+ roll ~(tap by rol.old)
|
||||
|= [[who=ship foreign] caz=(list card) rol=rolodex]
|
||||
?. ?& =([%chi ~] sag)
|
||||
!(~(has by wex.bowl) [/contact who dap.bowl])
|
||||
==
|
||||
[caz (~(put by rol) who for sag)]
|
||||
:- :_ caz
|
||||
=/ =path [%contact ?~(for / /at/(scot %da wen.for))]
|
||||
[%pass /contact %agent [who dap.bowl] %watch path]
|
||||
(~(put by rol) who for %want)
|
||||
=. state old
|
||||
=. cor (emil cards)
|
||||
:: [compat] if our protocol version changed
|
||||
::
|
||||
:: we first tell the world, then see if we can now understand
|
||||
|
Loading…
Reference in New Issue
Block a user