link-proxy-hook: fix incorrect scry paths

We were scrying for /gx/path instead of /gx/=link-store=/path.
In the %annotations case, that path wasn't even correct.

Also refactors scries out into a +scry-for helper.
This commit is contained in:
Fang 2020-02-14 23:35:04 +01:00
parent 5d01b4750b
commit f2cf3d43d3
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -114,13 +114,8 @@
?& ?=(^ group)
(~(has in u.group) who)
==
.^ (unit group:group-store)
%gx
(scot %p our.bowl)
%group-store
(scot %da now.bowl)
(snoc u.target %noun)
==
%+ scry-for (unit group:group-store)
[%group-store u.target]
::
:: groups subscription
::TODO largely copied from link-listen-hook. maybe make a store-listener lib?
@ -216,10 +211,14 @@
[%give %fact ~ %link-initial !>(initial)]
?+ path !!
[%local-pages ^]
[%local-pages .^((map ^path pages) %gx path)]
:- %local-pages
%+ scry-for (map ^path pages)
[%link-store path]
::
[%annotations ~ ^]
[%annotations .^((per-path-url notes) %gx '' t.t.path)]
[%annotations %$ ^]
:- %annotations
%+ scry-for (per-path-url notes)
[%link-store path]
==
::
++ start-proxy
@ -249,4 +248,14 @@
:: else, close the local subscription.
::
[(proxy-pass-link-store path %leave ~)]~
::
++ scry-for
|* [=mold app=term =path]
.^ mold
%gx
(scot %p our.bowl)
app
(scot %da now.bowl)
(snoc `^path`path %noun)
==
--