sane: update for new metadata-store

This commit is contained in:
Liam Fitzgerald 2021-01-14 13:46:16 +10:00
parent 2cfa0f073f
commit c6ae0cec53
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -33,9 +33,8 @@
+$ issue +$ issue
$% [%lib-pull-hook-desync app=term =resource] $% [%lib-pull-hook-desync app=term =resource]
[%lib-push-hook-desync app=term =resource] [%lib-push-hook-desync app=term =resource]
[%md-hook-desync =path]
[%contact-hook-desync =path] [%contact-hook-desync =path]
[%dangling-md =path] [%dangling-md =resource]
== ==
:: ::
+$ issues +$ issues
@ -125,6 +124,7 @@
++ check-all ++ check-all
=> (lib-hooks-desync %group scry-groups) => (lib-hooks-desync %group scry-groups)
=> (lib-hooks-desync %graph get-keys:gra) => (lib-hooks-desync %graph get-keys:gra)
=> (lib-hooks-desync %metadata scry-groups)
=> groups => groups
metadata metadata
:: ::
@ -136,22 +136,18 @@
?~ groups ?~ groups
fk-core fk-core
=* group i.groups =* group i.groups
=? fk-core !(~(has in scry-md-syncs) group)
(report %md-hook-desync (en-path:resource group))
=? fk-core &((is-managed:grp group) !(~(has in scry-contact-syncs) group)) =? fk-core &((is-managed:grp group) !(~(has in scry-contact-syncs) group))
(report %contact-hook-desync (en-path:resource group)) (report %contact-hook-desync (en-path:resource group))
$(groups t.groups) $(groups t.groups)
:: ::
++ metadata ++ metadata
^+ fk-core ^+ fk-core
=/ md-groups=(list path) =/ md-groups=(list resource)
~(tap in ~(key by md-group-indices)) ~(tap in ~(key by md-group-indices))
|- |-
?~ md-groups ?~ md-groups
fk-core fk-core
=/ rid=resource =? fk-core !(~(has in scry-groups) i.md-groups)
(de-path:resource i.md-groups)
=? fk-core !(~(has in scry-groups) rid)
(report %dangling-md i.md-groups) (report %dangling-md i.md-groups)
$(md-groups t.md-groups) $(md-groups t.md-groups)
:: ::
@ -212,15 +208,6 @@
:: ::
%lib-push-hook-desync %lib-push-hook-desync
(poke-our app.issue push-hook-action+!>([%add resource.issue]))^~ (poke-our app.issue push-hook-action+!>([%add resource.issue]))^~
::
%md-hook-desync
=/ rid=resource
(de-path:resource path.issue)
=/ act
?: =(entity.rid our.bowl)
[%add-owned path.issue]
[%add-synced entity.rid path.issue]
(poke-our %metadata-hook metadata-hook-action+!>(act))^~
:: ::
%contact-hook-desync %contact-hook-desync
=/ rid=resource =/ rid=resource
@ -233,12 +220,12 @@
:: ::
%dangling-md %dangling-md
=/ app-indices =/ app-indices
(~(get ju md-group-indices) path.issue) (~(get ju md-group-indices) resource.issue)
%+ turn %+ turn
~(tap in app-indices) ~(tap in app-indices)
|= =md-resource |= =md-resource
^- card ^- card
(poke-our %metadata-store metadata-action+!>([%remove path.issue md-resource])) (poke-our %metadata-store metadata-action+!>([%remove resource.issue md-resource]))
== ==
:: ::
++ poke-our ++ poke-our
@ -265,13 +252,6 @@
,(set resource) ,(set resource)
/x/[hook]/sharing/noun /x/[hook]/sharing/noun
:: ::
++ scry-md-syncs
^- (set resource)
=- (~(run in -) de-path:resource)
%+ scry
,(set path)
/x/metadata-hook/synced/noun
::
++ scry-contact-syncs ++ scry-contact-syncs
^- (set resource) ^- (set resource)
=- (~(run in -) de-path:resource) =- (~(run in -) de-path:resource)
@ -291,8 +271,9 @@
,(set path) ,(set path)
/x/chat-store/keys/noun /x/chat-store/keys/noun
:: ::
::
++ md-group-indices ++ md-group-indices
(scry (jug group-path md-resource) /y/metadata-store/group-indices) (scry (jug resource md-resource) /y/metadata-store/group-indices)
:: ::
++ scry ++ scry
|* [=mold =path] |* [=mold =path]