mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
Merge pull request #6827 from urbit/develop
Merge develop to next/kelvin/411
This commit is contained in:
commit
679cd0b3e8
@ -628,6 +628,8 @@
|
||||
:: duct: ['/paths', ...],
|
||||
:: message-num: 123
|
||||
:: }, ...],
|
||||
:: closing: [bone, ..., bone],
|
||||
:: corked: [bone, ..., bone],
|
||||
:: heeds: [['/paths', ...] ...]
|
||||
:: scries:
|
||||
:: -> { =path
|
||||
@ -706,8 +708,8 @@
|
||||
|^ =/ mix=(list flow)
|
||||
=- (sort - dor)
|
||||
%+ welp
|
||||
(turn ~(tap by snd) (tack %snd))
|
||||
(turn ~(tap by rcv) (tack %rcv))
|
||||
(turn ~(tap by snd) (tack %snd closing corked))
|
||||
(turn ~(tap by rcv) (tack %rcv closing corked))
|
||||
=/ [forward=(list flow) backward=(list flow)]
|
||||
%+ skid mix
|
||||
|= [=bone *]
|
||||
@ -719,6 +721,8 @@
|
||||
::
|
||||
+$ flow
|
||||
$: =bone
|
||||
closing=?
|
||||
corked=?
|
||||
::
|
||||
$= state
|
||||
$% [%snd message-pump-state]
|
||||
@ -727,17 +731,17 @@
|
||||
==
|
||||
::
|
||||
++ tack
|
||||
|* =term
|
||||
|* [=term closing=(set bone) corked=(set bone)]
|
||||
|* [=bone =noun]
|
||||
[bone [term noun]]
|
||||
[bone (~(has in closing) bone) (~(has in corked) bone) [term noun]]
|
||||
::
|
||||
++ build
|
||||
|= flow
|
||||
^- json
|
||||
%+ frond -.state
|
||||
?- -.state
|
||||
%snd (snd-with-bone ossuary bone +.state)
|
||||
%rcv (rcv-with-bone ossuary bone +.state)
|
||||
%snd (snd-with-bone ossuary bone closing corked +.state)
|
||||
%rcv (rcv-with-bone ossuary bone closing corked +.state)
|
||||
==
|
||||
--
|
||||
::
|
||||
@ -749,6 +753,10 @@
|
||||
:* 'message-num'^(numb message-num)
|
||||
(bone-to-pairs bone ossuary)
|
||||
==
|
||||
::
|
||||
'closing'^(set-array closing numb)
|
||||
::
|
||||
'corked'^(set-array corked numb)
|
||||
::
|
||||
'heeds'^(set-array heeds from-duct)
|
||||
::
|
||||
@ -756,10 +764,12 @@
|
||||
==
|
||||
::
|
||||
++ snd-with-bone
|
||||
|= [=ossuary =bone message-pump-state]
|
||||
|= [=ossuary =bone closing=? corked=? message-pump-state]
|
||||
^- json
|
||||
%- pairs
|
||||
:* 'current'^(numb current)
|
||||
:* 'closing'^b+closing
|
||||
'corked'^b+corked
|
||||
'current'^(numb current)
|
||||
'next'^(numb next)
|
||||
::
|
||||
:- 'unsent-messages' :: as byte sizes
|
||||
@ -811,10 +821,12 @@
|
||||
==
|
||||
::
|
||||
++ rcv-with-bone
|
||||
|= [=ossuary =bone message-sink-state]
|
||||
|= [=ossuary =bone closing=? corked=? message-sink-state]
|
||||
^- json
|
||||
%- pairs
|
||||
:* 'last-acked'^(numb last-acked)
|
||||
:* 'closing'^b+closing
|
||||
'corked'^b+corked
|
||||
'last-acked'^(numb last-acked)
|
||||
'last-heard'^(numb last-heard)
|
||||
::
|
||||
:- 'pending-vane-ack'
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2727,6 +2727,34 @@
|
||||
+$ bitt (map duct (pair ship path)) :: incoming subs
|
||||
+$ boat (map [=wire =ship =term] [acked=? =path]) :: outgoing subs
|
||||
+$ boar (map [=wire =ship =term] nonce=@) :: and their nonces
|
||||
::
|
||||
+$ path-state
|
||||
$: bob=(unit @ud)
|
||||
fan=((mop @ud (pair @da (each page @uvI))) lte)
|
||||
==
|
||||
+$ stats :: statistics
|
||||
$: change=@ud :: processed move count
|
||||
eny=@uvJ :: entropy
|
||||
time=@da :: current event time
|
||||
==
|
||||
+$ egg :: migratory agent state
|
||||
$% [%nuke sky=(map spur @ud)] :: see /sys/gall $yoke
|
||||
$: %live
|
||||
control-duct=duct
|
||||
run-nonce=@t
|
||||
sub-nonce=@
|
||||
=stats
|
||||
=bitt
|
||||
=boat
|
||||
=boar
|
||||
code=~
|
||||
old-state=[%| vase]
|
||||
=beak
|
||||
marks=(map duct mark)
|
||||
sky=(map spur path-state)
|
||||
ken=(jug spar:ames wire)
|
||||
== ==
|
||||
+$ egg-any $%([%15 egg])
|
||||
+$ bowl :: standard app state
|
||||
$: $: our=ship :: host
|
||||
src=ship :: guest
|
||||
|
@ -2023,11 +2023,11 @@
|
||||
%- (slog leaf+"ames: turning off dead flow consolidation" ~)
|
||||
=. event-core
|
||||
(emit:event-core duct.u.ded %pass wire.u.ded %b %rest date.u.ded)
|
||||
(wake-dead-flows:event-core %.n ~)
|
||||
(wake-dead-flows:event-core ~)
|
||||
::
|
||||
%- (slog leaf+"ames: switching to dead flow consolidation" ~)
|
||||
=; cor=event-core
|
||||
(wake-dead-flows:cor %.y ~)
|
||||
set-dead-flow-timer:(wake-dead-flows:cor ~)
|
||||
%- ~(rep by peers.ames-state:event-core)
|
||||
|= [[=ship =ship-state] core=_event-core]
|
||||
^+ event-core
|
||||
@ -2481,27 +2481,26 @@
|
||||
++ cork-bone |=(=bone abet:(on-cork-flow:peer-core bone))
|
||||
++ kill-bone |=(=bone abet:(on-kill-flow:peer-core bone))
|
||||
--
|
||||
:: +wake-dead-flow: call on-wake on all dead flows, optionally setting new
|
||||
:: dead flow timer
|
||||
:: +set-dead-flow-timer: set dead flow timer and corresponding ames state
|
||||
::
|
||||
++ wake-dead-flows
|
||||
|= [set-new-timer=? error=(unit tang)]
|
||||
++ set-dead-flow-timer
|
||||
^+ event-core
|
||||
=. flow.dead.ames-state.event-core
|
||||
?. set-new-timer
|
||||
flow/~
|
||||
flow/`[~[/ames] /dead-flow `@da`(add now ~m2)]
|
||||
=. event-core
|
||||
?. set-new-timer
|
||||
event-core
|
||||
(emit:event-core ~[/ames] %pass /dead-flow %b %wait `@da`(add now ~m2))
|
||||
(emit:event-core ~[/ames] %pass /dead-flow %b %wait `@da`(add now ~m2))
|
||||
:: +wake-dead-flows: call on-wake on all dead flows, discarding any
|
||||
:: ames-state changes
|
||||
::
|
||||
++ wake-dead-flows
|
||||
|= [error=(unit tang)]
|
||||
^+ event-core
|
||||
%- ~(rep by peers.ames-state:event-core)
|
||||
|= [[=ship =ship-state] core=_event-core]
|
||||
^+ event-core
|
||||
=/ peer-state=(unit peer-state) (get-peer-state:core ship)
|
||||
?~ peer-state core
|
||||
=/ peer-core (abed-peer:pe:core ship u.peer-state)
|
||||
=< abet
|
||||
=< abort
|
||||
^+ peer-core
|
||||
%- ~(rep by snd.u.peer-state)
|
||||
|= [[=bone =message-pump-state] cor=_peer-core]
|
||||
@ -2530,7 +2529,7 @@
|
||||
(request-attestation u.ship)
|
||||
::
|
||||
?: ?=([%dead-flow ~] wire)
|
||||
(wake-dead-flows %.y error)
|
||||
set-dead-flow-timer:(wake-dead-flows error)
|
||||
::
|
||||
?. ?=([%recork ~] wire)
|
||||
=/ res=(unit ?([%fine her=ship =^wire] [%pump her=ship =bone]))
|
||||
@ -3122,6 +3121,7 @@
|
||||
channel [[our ship] now channel-state -.peer]
|
||||
==
|
||||
::
|
||||
++ abort event-core :: keeps moves, discards state changes
|
||||
++ abet
|
||||
^+ event-core
|
||||
=. peers.ames-state
|
||||
@ -5326,6 +5326,9 @@
|
||||
:: /ax/snubbed (?(%allow %deny) (list ship))
|
||||
:: /ax/fine/hunk/[path/...] (list @ux) scry response fragments
|
||||
:: /ax/fine/ducts/[path/] (list duct)
|
||||
:: /ax/rift @
|
||||
:: /ax/corked/[ship] (set bone)
|
||||
:: /ax/closing/[ship] (set bone)
|
||||
::
|
||||
?. ?=(%x ren) ~
|
||||
=> .(tyl `(pole knot)`tyl)
|
||||
@ -5498,5 +5501,19 @@
|
||||
::
|
||||
[%rift ~]
|
||||
``noun+!>(rift.ames-state)
|
||||
::
|
||||
[%corked her=@ ~]
|
||||
=/ who (slaw %p her.tyl)
|
||||
?~ who [~ ~]
|
||||
=/ per (~(get by peers.ames-state) u.who)
|
||||
?. ?=([~ %known *] per) [~ ~]
|
||||
``noun+!>(corked.u.per)
|
||||
::
|
||||
[%closing her=@ ~]
|
||||
=/ who (slaw %p her.tyl)
|
||||
?~ who [~ ~]
|
||||
=/ per (~(get by peers.ames-state) u.who)
|
||||
?. ?=([~ %known *] per) [~ ~]
|
||||
``noun+!>(closing.u.per)
|
||||
==
|
||||
--
|
||||
|
@ -366,6 +366,8 @@
|
||||
}
|
||||
button[type=submit] {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
button[type=submit], a.button {
|
||||
font-size: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
@ -373,6 +375,7 @@
|
||||
color: var(--white);
|
||||
border: none;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
input:invalid ~ button[type=submit] {
|
||||
border-color: currentColor;
|
||||
@ -380,7 +383,7 @@
|
||||
color: var(--gray-400);
|
||||
pointer-events: none;
|
||||
}
|
||||
span.guest {
|
||||
span.guest, span.guest a {
|
||||
color: var(--gray-400);
|
||||
}
|
||||
span.failed {
|
||||
@ -475,8 +478,13 @@
|
||||
;div#local
|
||||
;p:"Urbit ID"
|
||||
;input(value "{(scow %p our)}", disabled "true", class "mono");
|
||||
;p:"Access Key"
|
||||
;+ ?: =(%ours -.identity)
|
||||
;div
|
||||
;p:"Already authenticated"
|
||||
;a.button/"{(trip (fall redirect-url '/'))}":"Continue"
|
||||
==
|
||||
;form(action "/~/login", method "post", enctype "application/x-www-form-urlencoded")
|
||||
;p:"Access Key"
|
||||
;input
|
||||
=type "password"
|
||||
=name "password"
|
||||
@ -519,10 +527,13 @@
|
||||
;button(name "eauth", type "submit"):"Continue"
|
||||
==
|
||||
==
|
||||
;* ?. ?=(%fake -.identity) ~
|
||||
;* ?: ?=(%ours -.identity) ~
|
||||
=+ id=(trim 29 (scow %p who.identity))
|
||||
=+ as="proceed as{?:(?=(%fake -.identity) " guest" "")}"
|
||||
;+ ;span.guest.mono
|
||||
; Current guest identity:
|
||||
; Or
|
||||
;a/"{(trip (fall redirect-url '/'))}":"{as}"
|
||||
; :
|
||||
;br;
|
||||
; {p.id}
|
||||
;br;
|
||||
@ -1242,33 +1253,14 @@
|
||||
=/ with-eauth=(unit ?)
|
||||
?: =(~ eauth-url:eauth) ~
|
||||
`?=(^ (get-header:http 'eauth' args.request-line))
|
||||
:: if we received a simple get: redirect if logged in, otherwise
|
||||
:: show login page
|
||||
:: if we received a simple get: show the login page
|
||||
::
|
||||
::NOTE we never auto-redirect, to avoid redirect loops with apps that
|
||||
:: send unprivileged users to the login screen
|
||||
::
|
||||
?: =('GET' method.request)
|
||||
?. (request-is-logged-in request)
|
||||
%^ return-static-data-on-duct 200 'text/html'
|
||||
(login-page redirect our identity with-eauth %.n)
|
||||
=/ session-id (session-id-from-request request)
|
||||
:: session-id should always be populated here since we are logged in
|
||||
?~ session-id
|
||||
%^ return-static-data-on-duct 200 'text/html'
|
||||
(login-page redirect our identity with-eauth %.n)
|
||||
=/ cookie-line=@t
|
||||
(session-cookie-string u.session-id &)
|
||||
=/ actual-redirect
|
||||
?~ redirect '/'
|
||||
?:(=(u.redirect '') '/' u.redirect)
|
||||
%- handle-response
|
||||
:* %start
|
||||
:- status-code=303
|
||||
^= headers
|
||||
:~ ['location' actual-redirect]
|
||||
['set-cookie' cookie-line]
|
||||
==
|
||||
data=~
|
||||
complete=%.y
|
||||
==
|
||||
%^ return-static-data-on-duct 200 'text/html'
|
||||
(login-page redirect our identity with-eauth %.n)
|
||||
:: if we are not a post, return an error
|
||||
::
|
||||
?. =('POST' method.request)
|
||||
@ -2238,12 +2230,20 @@
|
||||
[%b %rest expiration-time]
|
||||
:: +on-get-request: handles a GET request
|
||||
::
|
||||
:: GET requests open a channel for the server to send events to the
|
||||
:: client in text/event-stream format.
|
||||
:: GET requests connect to a channel for the server to send events to
|
||||
:: the client in text/event-stream format.
|
||||
::
|
||||
++ on-get-request
|
||||
|= [channel-id=@t [session-id=@uv =identity] =request:http]
|
||||
^- [(list move) server-state]
|
||||
:: if the channel doesn't exist, we cannot serve it.
|
||||
:: this 404 also lets clients know if their channel was reaped since
|
||||
:: they last connected to it.
|
||||
::
|
||||
?. (~(has by session.channel-state.state) channel-id)
|
||||
%^ return-static-data-on-duct 404 'text/html'
|
||||
(error-page 404 | url.request ~)
|
||||
::
|
||||
=/ mode=?(%json %jam)
|
||||
(find-channel-mode %'GET' header-list.request)
|
||||
=^ [exit=? =wall moves=(list move)] state
|
||||
@ -2253,23 +2253,14 @@
|
||||
?~ maybe-raw-header=(get-header:http 'last-event-id' header-list.request)
|
||||
~
|
||||
(rush u.maybe-raw-header dum:ag)
|
||||
:: if the channel doesn't exist yet, simply instantiate it here
|
||||
::
|
||||
?~ maybe-channel=(~(get by session.channel-state.state) channel-id)
|
||||
=- [[| ~ ~] state(session.channel-state -)]
|
||||
%+ ~(put by session.channel-state.state) channel-id
|
||||
::NOTE some other fields initialized at the end of this arm
|
||||
%* . *channel
|
||||
identity identity
|
||||
next-id (fall maybe-last-event-id 0)
|
||||
last-ack now
|
||||
==
|
||||
:: if the channel does exist, we put some demands on the get request,
|
||||
:: and may need to do some cleanup for prior requests.
|
||||
=/ channel
|
||||
(~(got by session.channel-state.state) channel-id)
|
||||
:: we put some demands on the get request, and may need to do some
|
||||
:: cleanup for prior requests.
|
||||
::
|
||||
:: find the channel creator's identity, make sure it matches
|
||||
::
|
||||
?. =(identity identity.u.maybe-channel)
|
||||
?. =(identity identity.channel)
|
||||
=^ mos state
|
||||
%^ return-static-data-on-duct 403 'text/html'
|
||||
(error-page 403 | url.request ~)
|
||||
@ -2278,34 +2269,34 @@
|
||||
::
|
||||
::TODO or could we change that on the spot, given that only a single
|
||||
:: request will ever be listening to this channel?
|
||||
?. =(mode mode.u.maybe-channel)
|
||||
?. =(mode mode.channel)
|
||||
=^ mos state
|
||||
%^ return-static-data-on-duct 406 'text/html'
|
||||
=; msg=tape (error-page 406 %.y url.request msg)
|
||||
"channel already established in {(trip mode.u.maybe-channel)} mode"
|
||||
"channel already established in {(trip mode.channel)} mode"
|
||||
[[& ~ mos] state]
|
||||
:: when opening an event-stream, we must cancel our timeout timer
|
||||
:: if there's no duct already bound. else, kill the old request,
|
||||
:: we will replace its duct at the end of this arm
|
||||
::
|
||||
=^ cancel-moves state
|
||||
?: ?=([%& *] state.u.maybe-channel)
|
||||
?: ?=([%& *] state.channel)
|
||||
:_ state
|
||||
(cancel-timeout-move channel-id p.state.u.maybe-channel)^~
|
||||
(cancel-timeout-move channel-id p.state.channel)^~
|
||||
=. duct-to-key.channel-state.state
|
||||
(~(del by duct-to-key.channel-state.state) p.state.u.maybe-channel)
|
||||
(~(del by duct-to-key.channel-state.state) p.state.channel)
|
||||
=/ cancel-heartbeat
|
||||
?~ heartbeat.u.maybe-channel ~
|
||||
?~ heartbeat.channel ~
|
||||
:_ ~
|
||||
%+ cancel-heartbeat-move channel-id
|
||||
[date duct]:u.heartbeat.u.maybe-channel
|
||||
[date duct]:u.heartbeat.channel
|
||||
=- [(weld cancel-heartbeat -<) ->]
|
||||
(handle-response(duct p.state.u.maybe-channel) [%cancel ~])
|
||||
(handle-response(duct p.state.channel) [%cancel ~])
|
||||
:: flush events older than the passed in 'Last-Event-ID'
|
||||
::
|
||||
=? state ?=(^ maybe-last-event-id)
|
||||
(acknowledge-events channel-id u.maybe-last-event-id)
|
||||
::TODO that did not remove them from the u.maybe-channel queue though!
|
||||
::TODO that did not remove them from the channel queue though!
|
||||
:: we may want to account for maybe-last-event-id, for efficiency.
|
||||
:: (the client _should_ ignore events it heard previously if we do
|
||||
:: end up re-sending them, but _requiring_ that feels kinda risky)
|
||||
@ -2316,7 +2307,7 @@
|
||||
[[| - cancel-moves] state]
|
||||
%- zing
|
||||
%- flop
|
||||
=/ queue events.u.maybe-channel
|
||||
=/ queue events.channel
|
||||
=| events=(list wall)
|
||||
|-
|
||||
^+ events
|
||||
@ -2328,7 +2319,7 @@
|
||||
:: since conversion failure also gets caught during first receive.
|
||||
:: we can't do anything about this, so consider it unsupported.
|
||||
=/ said
|
||||
(channel-event-to-tape u.maybe-channel request-id channel-event)
|
||||
(channel-event-to-tape channel request-id channel-event)
|
||||
?~ said $
|
||||
$(events [(event-tape-to-wall id +.u.said) events])
|
||||
?: exit [moves state]
|
||||
@ -2393,6 +2384,8 @@
|
||||
::
|
||||
:: PUT requests send commands from the client to the server. We receive
|
||||
:: a set of commands in JSON format in the body of the message.
|
||||
:: channels don't exist until a PUT request is sent. it's valid for
|
||||
:: this request to contain an empty list of commands.
|
||||
::
|
||||
++ on-put-request
|
||||
|= [channel-id=@t =identity =request:http]
|
||||
|
@ -42,9 +42,9 @@
|
||||
:: $move: Arvo-level move
|
||||
::
|
||||
+$ move [=duct move=(wind note-arvo gift-arvo)]
|
||||
:: $state-13: overall gall state, versioned
|
||||
:: $state-15: overall gall state, versioned
|
||||
::
|
||||
+$ state-14 [%14 state]
|
||||
+$ state-15 [%15 state]
|
||||
:: $state: overall gall state
|
||||
::
|
||||
:: system-duct: TODO document
|
||||
@ -53,6 +53,7 @@
|
||||
:: yokes: running agents
|
||||
:: blocked: moves to agents that haven't been started yet
|
||||
:: bug: debug printing configuration
|
||||
:: leaves: retry nacked %leaves timer, if set
|
||||
::
|
||||
+$ state
|
||||
$: system-duct=duct
|
||||
@ -61,6 +62,7 @@
|
||||
yokes=(map term yoke)
|
||||
blocked=(map term (qeu blocked-move))
|
||||
=bug
|
||||
leaves=(unit [=duct =wire date=@da])
|
||||
==
|
||||
:: $routes: new cuff; TODO: document
|
||||
::
|
||||
@ -102,26 +104,10 @@
|
||||
ken=(jug spar:ames wire)
|
||||
== ==
|
||||
::
|
||||
+$ path-state
|
||||
$: bob=(unit @ud)
|
||||
fan=((mop @ud (pair @da (each page @uvI))) lte)
|
||||
==
|
||||
::
|
||||
++ on-path ((on @ud (pair @da (each page @uvI))) lte)
|
||||
:: $blocked-move: enqueued move to an agent
|
||||
::
|
||||
+$ blocked-move [=duct =routes move=(each deal unto)]
|
||||
:: $stats: statistics
|
||||
::
|
||||
:: change: how many moves this agent has processed
|
||||
:: eny: entropy
|
||||
:: time: date of current event processing
|
||||
::
|
||||
+$ stats [change=@ud eny=@uvJ time=@da]
|
||||
:: $ames-response: network response message (%boon)
|
||||
::
|
||||
:: %d: fact
|
||||
:: %x: quit
|
||||
::
|
||||
+$ ames-response
|
||||
$% [%d =mark noun=*]
|
||||
@ -161,38 +147,22 @@
|
||||
::
|
||||
:: $spore: structures for update, produced by +stay
|
||||
::
|
||||
:: remember to duplicate version tag changes here to $egg-any:gall in lull
|
||||
::
|
||||
+$ spore
|
||||
$: %14
|
||||
$: %15
|
||||
system-duct=duct
|
||||
outstanding=(map [wire duct] (qeu remote-request))
|
||||
contacts=(set ship)
|
||||
eggs=(map term egg)
|
||||
blocked=(map term (qeu blocked-move))
|
||||
=bug
|
||||
leaves=(unit [=duct =wire date=@da])
|
||||
==
|
||||
:: $egg: migratory agent state; $yoke with .old-state instead of .agent
|
||||
::
|
||||
+$ egg
|
||||
$% [%nuke sky=(map spur @ud)]
|
||||
$: %live
|
||||
control-duct=duct
|
||||
run-nonce=@t
|
||||
sub-nonce=@
|
||||
=stats
|
||||
=bitt
|
||||
=boat
|
||||
=boar
|
||||
code=~
|
||||
old-state=[%| vase]
|
||||
=beak
|
||||
marks=(map duct mark)
|
||||
sky=(map spur path-state)
|
||||
ken=(jug spar:ames wire)
|
||||
== ==
|
||||
--
|
||||
:: adult gall vane interface, for type compatibility with pupa
|
||||
::
|
||||
=| state=state-14
|
||||
=| state=state-15
|
||||
|= [now=@da eny=@uvJ rof=roof]
|
||||
=* gall-payload .
|
||||
~% %gall-top ..part ~
|
||||
@ -220,7 +190,8 @@
|
||||
++ mo-core .
|
||||
++ mo-abed |=(hun=duct mo-core(hen hun))
|
||||
++ mo-abet [(flop moves) gall-payload]
|
||||
++ mo-give |=(g=gift mo-core(moves [[hen give+g] moves]))
|
||||
++ mo-emit |=(=move mo-core(moves [move moves]))
|
||||
++ mo-give |=(=gift (mo-emit hen give+gift))
|
||||
++ mo-talk
|
||||
|= rup=(each suss tang)
|
||||
^- [wire note-arvo]
|
||||
@ -230,8 +201,8 @@
|
||||
%& [%text "gall: {(t q)}ed %{(t p)}":[t=trip p.rup]]
|
||||
%| [%talk leaf+"gall: failed" (flop p.rup)]
|
||||
==
|
||||
++ mo-pass |=(p=[wire note-arvo] mo-core(moves [[hen pass+p] moves]))
|
||||
++ mo-slip |=(p=note-arvo mo-core(moves [[hen slip+p] moves]))
|
||||
++ mo-pass |=(p=[wire note-arvo] (mo-emit hen pass+p))
|
||||
++ mo-slip |=(p=note-arvo (mo-emit hen slip+p))
|
||||
++ mo-past
|
||||
|= =(list [wire note-arvo])
|
||||
?~ list
|
||||
@ -370,12 +341,8 @@
|
||||
=. outstanding.state
|
||||
=/ stand
|
||||
(~(gut by outstanding.state) [wire hen] *(qeu remote-request))
|
||||
%+ ~(put by outstanding.state) [wire hen]
|
||||
(~(gas to stand) ?.(?=(%leave -.deal) ~[-.deal] ~[%leave]))
|
||||
=. mo-core (mo-pass wire note-arvo)
|
||||
?. ?=(%leave -.deal)
|
||||
mo-core
|
||||
(mo-pass wire [%a [%cork ship]])
|
||||
(~(put by outstanding.state) [wire hen] (~(put to stand) -.deal))
|
||||
(mo-pass wire note-arvo)
|
||||
:: +mo-track-ship: subscribe to ames and jael for notices about .ship
|
||||
::
|
||||
++ mo-track-ship
|
||||
@ -529,6 +496,10 @@
|
||||
::
|
||||
?+ sign-arvo !!
|
||||
[%ames %done *]
|
||||
=/ err=(unit tang)
|
||||
?~ error=error.sign-arvo
|
||||
~
|
||||
`[[%leaf (trip tag.u.error)] tang.u.error]
|
||||
=^ remote-request outstanding.state
|
||||
?~ t.t.t.wire
|
||||
=/ full-wire sys+wire
|
||||
@ -545,29 +516,42 @@
|
||||
=^ rr stand ~(get to stand)
|
||||
:- rr
|
||||
?: =(~ stand)
|
||||
:: outstanding leaves are only deleted when acked
|
||||
::
|
||||
?: &(?=(^ err) ?=(%leave rr))
|
||||
outstanding.state
|
||||
(~(del by outstanding.state) [full-wire hen])
|
||||
(~(put by outstanding.state) [full-wire hen] stand)
|
||||
:: non-null case of wire is old, remove on next breach after
|
||||
:: 2019/12
|
||||
::
|
||||
[;;(remote-request i.t.t.t.wire) outstanding.state]
|
||||
::
|
||||
=/ err=(unit tang)
|
||||
?~ error=error.sign-arvo
|
||||
~
|
||||
`[[%leaf (trip tag.u.error)] tang.u.error]
|
||||
:: send a %cork if we get a nack upon initial subscription
|
||||
:: send a %cork if we get a %nack upon initial subscription
|
||||
::
|
||||
=? mo-core
|
||||
&(?=(^ err) |(?=(%watch-as remote-request) ?=(%watch remote-request)))
|
||||
(mo-pass [%sys wire] %a %cork ship)
|
||||
(mo-pass sys+wire %a %cork ship)
|
||||
::
|
||||
?- remote-request
|
||||
%watch-as (mo-give %unto %watch-ack err)
|
||||
%watch (mo-give %unto %watch-ack err)
|
||||
%poke (mo-give %unto %poke-ack err)
|
||||
%leave mo-core
|
||||
%missing ~>(%slog.[3 'gall: missing'] mo-core)
|
||||
::
|
||||
%leave
|
||||
:: if we get an %ack for a %leave, send %cork. otherwise,
|
||||
:: the /nacked-leaves timer will re-send the %leave eventually.
|
||||
::
|
||||
?~ err
|
||||
(mo-pass sys+wire %a %cork ship)
|
||||
:: if first time hearing a %nack for a %leave, after upgrade
|
||||
:: or if all outstanding %leaves have been handled, set up timer
|
||||
::
|
||||
=? mo-core ?=(~ leaves.state)
|
||||
(mo-emit [/gall]~ %pass /nacked-leaves %b %wait `@da`(add now ~m2))
|
||||
=? leaves.state ?=(~ leaves.state)
|
||||
`[[/gall]~ /nacked-leaves `@da`(add now ~m2)]
|
||||
mo-core
|
||||
==
|
||||
::
|
||||
[%ames %boon *]
|
||||
@ -905,6 +889,13 @@
|
||||
^+ mo-core
|
||||
=. dudes.bug.state (sy dudes)
|
||||
mo-core
|
||||
::
|
||||
++ mo-handle-nacked-leaves
|
||||
|= =wire
|
||||
^+ mo-core
|
||||
?> ?=([%sys %way @ @ ~] wire)
|
||||
(mo-pass wire %a %plea (slav %p &3.wire) %g /ge/[&4.wire] %0 %u ~)
|
||||
::
|
||||
:: +ap: agent engine
|
||||
::
|
||||
:: An inner, agent-level core. The sample refers to the agent we're
|
||||
@ -1546,7 +1537,7 @@
|
||||
++ on-bad-nonce
|
||||
|= stored-nonce=@
|
||||
%. ap-core
|
||||
%- slog :~
|
||||
%+ trace odd.veb.bug.state :~
|
||||
=/ nonces [expected=stored-nonce got=nonce]
|
||||
=/ ok |(?=(?(%fact %kick) -.sign) =(~ p.sign))
|
||||
leaf+"{<agent-name>}: stale {<-.sign>} {<nonces>} ok={<ok>}"
|
||||
@ -1955,18 +1946,37 @@
|
||||
::
|
||||
++ load
|
||||
|^ |= old=spore-any
|
||||
=? old ?=(%7 -.old) (spore-7-to-8 old)
|
||||
=? old ?=(%8 -.old) (spore-8-to-9 old)
|
||||
=? old ?=(%9 -.old) (spore-9-to-10 old)
|
||||
=? old ?=(%7 -.old) (spore-7-to-8 old)
|
||||
=? old ?=(%8 -.old) (spore-8-to-9 old)
|
||||
=? old ?=(%9 -.old) (spore-9-to-10 old)
|
||||
=? old ?=(%10 -.old) (spore-10-to-11 old)
|
||||
=? old ?=(%11 -.old) (spore-11-to-12 old)
|
||||
=? old ?=(%12 -.old) (spore-12-to-13 old)
|
||||
=? old ?=(%13 -.old) (spore-13-to-14 old)
|
||||
?> ?=(%14 -.old)
|
||||
=? old ?=(%14 -.old) (spore-14-to-15 old)
|
||||
?> ?=(%15 -.old)
|
||||
gall-payload(state old)
|
||||
::
|
||||
+$ spore-any
|
||||
$%(spore spore-7 spore-8 spore-9 spore-10 spore-11 spore-12 spore-13)
|
||||
$% spore
|
||||
spore-7
|
||||
spore-8
|
||||
spore-9
|
||||
spore-10
|
||||
spore-11
|
||||
spore-12
|
||||
spore-13
|
||||
spore-14
|
||||
==
|
||||
+$ spore-14
|
||||
$: %14
|
||||
system-duct=duct
|
||||
outstanding=(map [wire duct] (qeu remote-request))
|
||||
contacts=(set ship)
|
||||
eggs=(map term egg)
|
||||
blocked=(map term (qeu blocked-move))
|
||||
=bug
|
||||
==
|
||||
+$ spore-13
|
||||
$: %13
|
||||
system-duct=duct
|
||||
@ -2185,9 +2195,10 @@
|
||||
::
|
||||
++ spore-13-to-14
|
||||
|= old=spore-13
|
||||
^- spore
|
||||
^- spore-14
|
||||
%= old
|
||||
- %14
|
||||
::
|
||||
blocked
|
||||
^- (map term (qeu blocked-move))
|
||||
%- ~(run by blocked.old)
|
||||
@ -2200,6 +2211,12 @@
|
||||
attributing.routes [ship=attributing.routes.blocked path=/]
|
||||
==
|
||||
==
|
||||
:: added nacked-leaves timer
|
||||
::
|
||||
++ spore-14-to-15
|
||||
|= old=spore-14
|
||||
^- spore
|
||||
old(- %15, bug [bug.old ~])
|
||||
--
|
||||
:: +scry: standard scry
|
||||
::
|
||||
@ -2290,6 +2307,24 @@
|
||||
[~ ~]
|
||||
[~ ~ atom+!>(u.nonce)]
|
||||
::
|
||||
?: ?& =(%v care)
|
||||
=([%$ %da now] coin)
|
||||
=(our ship)
|
||||
==
|
||||
=/ yok (~(get by yokes.state) dap)
|
||||
?. ?=([~ %live *] yok)
|
||||
[~ ~]
|
||||
=/ =egg
|
||||
%= u.yok
|
||||
code ~
|
||||
agent
|
||||
:- %|
|
||||
?: ?=(%| -.agent.u.yok)
|
||||
p.agent.u.yok
|
||||
on-save:p.agent.u.yok
|
||||
==
|
||||
``noun+!>([-:*spore egg])
|
||||
::
|
||||
?: ?& =(%w care)
|
||||
=([%$ %da now] coin)
|
||||
=(our ship)
|
||||
@ -2412,6 +2447,24 @@
|
||||
=/ =gift ?>(?=([%behn %heck %gall *] syn) +>+.syn)
|
||||
[[duct %give gift]~ gall-payload]
|
||||
::
|
||||
?: ?=([%nacked-leaves ~] wire)
|
||||
=; core=_mo-core:mo
|
||||
:: next time a %leave gets nacked, the state and timer will be set again.
|
||||
::
|
||||
mo-abet:core(leaves.state ~)
|
||||
%- ~(rep by outstanding.state)
|
||||
|= [[[=^wire =^duct] stand=(qeu remote-request)] core=_mo-core:mo]
|
||||
?: =(~ stand) core
|
||||
=^ rr stand ~(get to stand)
|
||||
:: sanity check in the outstanding queue:
|
||||
:: if there's a %leave, that should be the only request
|
||||
::
|
||||
~? >>> &(?=(%leave rr) =(^ stand))
|
||||
"outstanding queue not empty [{<wire>} {<duct>} {<stand>}]"
|
||||
=? core &(?=(%leave rr) =(~ stand))
|
||||
(mo-handle-nacked-leaves:(mo-abed:core duct) wire)
|
||||
core
|
||||
::
|
||||
~| [%gall-take-failed wire]
|
||||
?> ?=([?(%sys %use) *] wire)
|
||||
=< mo-abet
|
||||
|
@ -12,7 +12,7 @@
|
||||
++ parse-current-version
|
||||
|= current=vere
|
||||
^- @t
|
||||
(rear rev.current)
|
||||
(slav %ta (rear rev.current))
|
||||
::
|
||||
++ is-equal-version
|
||||
|= [latest=@t current=vere]
|
||||
|
@ -153,8 +153,12 @@ export class Ames extends Component {
|
||||
snd['packet-pump-state'].live.length > 0 )
|
||||
? 'active, '
|
||||
: '';
|
||||
const color = snd['closing'] ? 'lightyellow': snd['corked'] ? 'lightred' : 'transparent';
|
||||
|
||||
return {key: 'snd ' + active + snd.bone + ', ' + renderDuct(snd.duct), jsx: (
|
||||
<Summary summary={summary} details={details} />
|
||||
<div style={{backgroundColor: color}}>
|
||||
<Summary summary={summary} details={details} />
|
||||
</div>
|
||||
)};
|
||||
}
|
||||
|
||||
@ -198,8 +202,12 @@ export class Ames extends Component {
|
||||
{nax}<br/>
|
||||
{liveMessages}
|
||||
</>);
|
||||
const color = rcv['closing'] ? 'ligthyellow': rcv['corked'] ? 'lightred' : 'transparent';
|
||||
|
||||
return {key: 'rcv ' + rcv.bone + ', ' + renderDuct(rcv.duct), jsx: (
|
||||
<Summary summary={summary} details={details} />
|
||||
<div style={{backgroundColor: color}}>
|
||||
<Summary summary={summary} details={details} />
|
||||
</div>
|
||||
)};
|
||||
}
|
||||
|
||||
@ -330,6 +338,13 @@ export class Ames extends Component {
|
||||
last contact {msToDa(p.qos['last-contact'])}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="inter">Bones </td>
|
||||
<td>
|
||||
closing: {p.closing.length},
|
||||
corked: {p.corked.length}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</>);
|
||||
|
||||
|
@ -749,13 +749,12 @@
|
||||
;< ~ bind:m perform-init-wo-timer
|
||||
;< ~ bind:m perform-born
|
||||
;< ~ bind:m (wait ~d1)
|
||||
;< ~ bind:m perform-authentication-2
|
||||
;< mos=(list move) bind:m
|
||||
(get '/~/channel/0123456789abcdef' cookie)
|
||||
;< now=@da bind:m get-now
|
||||
=/ mov-1 (ex-wait /channel/heartbeat/'0123456789abcdef' (add now ~s20))
|
||||
=/ mov-2 (ex-channel-response ~)
|
||||
(expect-moves mos mov-1 mov-2 ~)
|
||||
=/ headers ['content-type' 'text/html']~
|
||||
=/ body `(error-page:eyre-gate 404 %.n '/~/channel/0123456789abcdef' ~)
|
||||
(expect-moves mos (ex-response 404 headers body) ~)
|
||||
::
|
||||
++ test-channel-put-zero-requests
|
||||
%- eval-mare
|
||||
|
Loading…
Reference in New Issue
Block a user