From 8f368d3d5d37af506ab7af617a01cd9ef3ed57e9 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 24 Nov 2021 15:12:22 -0500 Subject: [PATCH] landscape: move /nack path into lib --- pkg/landscape/app/group-pull-hook.hoon | 12 +++--------- pkg/landscape/app/metadata-pull-hook.hoon | 2 -- pkg/landscape/lib/pull-hook.hoon | 18 ++++++++++++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/pkg/landscape/app/group-pull-hook.hoon b/pkg/landscape/app/group-pull-hook.hoon index 8da085fdf..f97582e70 100644 --- a/pkg/landscape/app/group-pull-hook.hoon +++ b/pkg/landscape/app/group-pull-hook.hoon @@ -37,10 +37,7 @@ ++ on-load on-load:def ++ on-poke on-poke:def ++ on-agent on-agent:def -++ on-watch - |= =path - ?. ?=([%nack ~] path) (on-watch:def path) - `this +++ on-watch on-watch:def ++ on-leave on-leave:def ++ on-peek on-peek:def ++ on-arvo on-arvo:def @@ -50,11 +47,8 @@ ^- (quip card _this) %- (slog tang) :_ this - :~ =- [%pass / %agent [our.bowl %group-store] %poke -] - group-update-0+!>([%remove-group resource ~]) - :: - `card`[%give %fact ~[/nack] resource+!>(resource)] - == + =- [%pass / %agent [our.bowl %group-store] %poke -]~ + group-update-0+!>([%remove-group resource ~]) :: ++ on-pull-kick |= =resource diff --git a/pkg/landscape/app/metadata-pull-hook.hoon b/pkg/landscape/app/metadata-pull-hook.hoon index 4cfe3bc7a..389d244bb 100644 --- a/pkg/landscape/app/metadata-pull-hook.hoon +++ b/pkg/landscape/app/metadata-pull-hook.hoon @@ -297,7 +297,6 @@ |= =path ?> (team:title [our src]:bowl) ?+ path (on-watch:def path) - [%nack ~] `this :: [%preview @ @ @ ~] =/ rid=resource @@ -325,7 +324,6 @@ =/ =associations:metadata (metadata-for-group:met resource) :_ this - :- `card`[%give %fact ~[/nack] resource+!>(resource)] %+ turn ~(tap by associations) |= [=md-resource:metadata =association:metadata] %+ poke-our:pass:io %metadata-store diff --git a/pkg/landscape/lib/pull-hook.hoon b/pkg/landscape/lib/pull-hook.hoon index d3f6a251f..a9e4f97d9 100644 --- a/pkg/landscape/lib/pull-hook.hoon +++ b/pkg/landscape/lib/pull-hook.hoon @@ -319,12 +319,18 @@ |= =path ^- [(list card:agent:gall) agent:gall] ?> (team:title our.bowl src.bowl) - ?. ?=([%tracking ~] path) + ?+ path + :: forward by default =^ cards pull-hook (on-watch:og path) [cards this] - :_ this - ~[give-update] + :: + [%nack ~] `this + :: + [%tracking ~] + :_ this + ~[give-update] + == :: ++ on-agent |= [=wire =sign:agent:gall] @@ -455,7 +461,8 @@ |= tan=(unit tang) ?~ tan tr-core ?. versioned - (tr-ap-og:tr-cleanup |.((on-pull-nack:og rid u.tan))) + %- tr-ap-og:tr-cleanup:tr-give-nack + |.((on-pull-nack:og rid u.tan)) %- (slog leaf+"versioned nack for {} in {}" u.tan) =/ pax (kick-mule:virt rid |.((on-pull-kick:og rid))) @@ -569,6 +576,9 @@ :: +| %subscription: subscription cards :: :: + ++ tr-give-nack + (tr-emit (fact:io resource+!>(rid) /nack ~)) + :: ++ tr-ver-wire (make-wire /version) ::