From bce1b3e65e41a6df3d7357b777c2187782ea3159 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 11 Dec 2020 14:57:20 +1000 Subject: [PATCH] group-pull-hook: remove group on nack --- pkg/arvo/app/graph-store.hoon | 2 +- pkg/arvo/app/group-pull-hook.hoon | 4 +++- pkg/arvo/ted/graph/leave.hoon | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 994dde11f..b04085fae 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -281,7 +281,7 @@ (~(put in validators) u.mark) == %- zing - :~ (give [/keys ~] %keys ~(key by graphs)) + :~ (give [/keys ~] %keys (~(put in ~(key by graphs)) resource)) (give [/updates ~] %add-graph resource *graph:store mark overwrite) clay-backup ?~ mark ~ diff --git a/pkg/arvo/app/group-pull-hook.hoon b/pkg/arvo/app/group-pull-hook.hoon index 413989763..9141c8e82 100644 --- a/pkg/arvo/app/group-pull-hook.hoon +++ b/pkg/arvo/app/group-pull-hook.hoon @@ -42,7 +42,9 @@ ++ on-pull-nack |= [=resource =tang] ^- (quip card _this) - [~ this] + :_ this + =- [%pass / %agent [our.bowl %group-store] %poke -]~ + group-update+!>([%remove-group resource ~]) ++ on-pull-kick |= =resource ^- (unit path) diff --git a/pkg/arvo/ted/graph/leave.hoon b/pkg/arvo/ted/graph/leave.hoon index 382841a7f..131d1f8eb 100644 --- a/pkg/arvo/ted/graph/leave.hoon +++ b/pkg/arvo/ted/graph/leave.hoon @@ -68,9 +68,9 @@ !> :+ %remove (en-path:resource rid.action) [%graph (en-path:resource rid.action)] -;< ~ bind:m - (poke-our %group-pull-hook %pull-hook-action !>([%remove rid.action])) ;< ~ bind:m (poke-our %group-store %group-action !>([%remove-group rid.action ~])) +;< ~ bind:m + (poke-our %group-pull-hook %pull-hook-action !>([%remove rid.action])) ;< ~ bind:m (delete-graph now.bowl rid.action) (pure:m !>(~))