Skip to content

Commit

Permalink
Merge branch 'staging' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 1, 2024
2 parents c674414 + 2d2151b commit fef2bb8
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 61 deletions.
125 changes: 77 additions & 48 deletions desk/app/expose.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
:_ this
:~ [%pass /eyre/connect %arvo %e %connect [~ /expose] dap.bowl]
[%pass /channels %agent [our.bowl %channels] %watch /v1]
[%pass /contacts %agent [our.bowl %contacts] %watch /contact]
==
::
++ on-save !>(state)
Expand Down Expand Up @@ -205,58 +206,86 @@
++ on-agent
|= [=wire =sign:agent:gall]
^- (quip card _this)
?. ?=([%channels ~] wire) [~ this]
?- -.sign
%poke-ack !!
%kick [[%pass /channels %agent [our.bowl %channels] %watch /v1]~ this]
::
%watch-ack
?~ p.sign [~ this]
~& >>> [dap.bowl %rejected-by-channels]
[~ this]
::
%fact
?. =(%channel-response-1 p.cage.sign) [~ this]
=+ !<(r-channels:d q.cage.sign)
::REVIEW should this handle %posts also?
?+ -.r-channel [~ this]
%post
=/ new=(unit $@(%del kind-data:d))
?+ -.r-post.r-channel ~
%set
?~ post.r-post.r-channel `%del
`kind-data.u.post.r-post.r-channel
::
%essay
`kind-data.essay.r-post.r-channel
==
?~ new [~ this]
?^ u.new
:: post was updated, refresh the relevant page's cache entry
?+ wire ~&([dap.bowl strange-wire=wire] [~ this])
[%channels ~]
?- -.sign
%poke-ack !!
%kick [[%pass /channels %agent [our.bowl %channels] %watch /v1]~ this]
::
%watch-ack
?~ p.sign [~ this]
~& >>> [dap.bowl %rejected-by-channels]
[~ this]
::
%fact
?. =(%channel-response-1 p.cage.sign) [~ this]
=+ !<(r-channels:d q.cage.sign)
::REVIEW should this handle %posts also?
?+ -.r-channel [~ this]
%post
=/ new=(unit $@(%del kind-data:d))
?+ -.r-post.r-channel ~
%set
?~ post.r-post.r-channel `%del
`kind-data.u.post.r-post.r-channel
::
%essay
`kind-data.essay.r-post.r-channel
==
?~ new [~ this]
?^ u.new
:: post was updated, refresh the relevant page's cache entry
::
:_ this
=/ ref=cite:c
(from-post:cite:u nest id.r-channel u.new)
?. (~(has in open) ref) ~
%+ weld
(refresh-widget:e bowl open)
(refresh-pages:e bowl ref ~)
:: post was deleted. if we have it, clear it out.
::
:_ this
::TODO this won't hold up in a freeform-channels world...
:: but not sure how else we'd get the msg type info for the cite.
=/ =kind-data:d
?- -.nest
%chat [%chat ~]
%diary [%diary '' '']
%heap [%heap ~]
==
=/ ref=cite:c
(from-post:cite:u nest id.r-channel u.new)
?. (~(has in open) ref) ~
%+ weld
(refresh-widget:e bowl open)
(refresh-pages:e bowl ref ~)
:: post was deleted. if we have it, clear it out.
(from-post:cite:u nest id.r-channel kind-data)
?. (~(has in open) ref) [~ this]
=. open (~(del in open) ref)
:_ this
[(clear-page:e ref) (refresh-widget:e bowl open)]
==
==
::
[%contacts ~]
?- -.sign
%poke-ack !!
%kick [[%pass /contacts %agent [our.bowl %conacts] %watch /contact]~ this]
::
%watch-ack
?~ p.sign [~ this]
~& >>> [dap.bowl %rejected-by-contacts]
[~ this]
::
%fact
:: our own contact details changes. assume this affects all pages we're
:: serving, refresh the cache.
:: note that we don't do this kind of reactivity for contact details of
:: other ships. at the extreme, reacting to that accurately in a non-
:: wasteful way would require trawling all content for relevane, which
:: in turn is slow. if we get to the point of wanting that to be
:: fresh(er), we should just set an hourly timer that re-render the
:: entire cache.
::
::TODO this won't hold up in a freeform-channels world...
:: but not sure how else we'd get the msg type info for the cite.
=/ =kind-data:d
?- -.nest
%chat [%chat ~]
%diary [%diary '' '']
%heap [%heap ~]
==
=/ ref=cite:c
(from-post:cite:u nest id.r-channel kind-data)
?. (~(has in open) ref) [~ this]
=. open (~(del in open) ref)
:_ this
[(clear-page:e ref) (refresh-widget:e bowl open)]
%+ weld
(refresh-widget:e bowl open)
(refresh-pages:e bowl ~(tap in open))
==
==
::
Expand Down
12 changes: 1 addition & 11 deletions desk/app/profile.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,7 @@
++ render-page
^- manx
=/ ours=(unit contact:contacts)
=, contacts
::NOTE we scry for the full rolodex, because we are not guaranteed to
:: have an entry for ourselves, and contacts doesn't expose a "safe"
:: (as in crashless) endpoint for checking
=+ .^ =rolodex
/gx/(scot %p our.bowl)/contacts/(scot %da now.bowl)/all/contact-rolodex
==
=/ =foreign (~(gut by rolodex) our.bowl *foreign)
?: ?=([[@ ^] *] foreign)
`con.for.foreign
~
(get-contact:contacts bowl our.bowl)
|^ ;html
;+ head
;+ body
Expand Down
6 changes: 4 additions & 2 deletions desk/sur/contacts.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
::
++ get-contact
|= [=bowl:gall who=@p]
^- (unit contact) ~+
=/ base=path /(scot %p our.bowl)/contacts/(scot %da now.bowl)
=> :_ ..get-contact
[who=who our=our.bowl now=now.bowl]
~+ ^- (unit contact)
=/ base=path /(scot %p our)/contacts/(scot %da now)
?. ~+ .^(? %gu (weld base /$))
~
=+ ~+ .^(rol=rolodex %gx (weld base /all/contact-rolodex))
Expand Down

0 comments on commit fef2bb8

Please sign in to comment.