From fa9a7dc0f0044bfe0e4d7268c3ad966a1c7e386e Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Thu, 12 Nov 2020 10:26:24 +1000 Subject: [PATCH] hark-store: do not give all notifications in +on-watch --- pkg/arvo/app/hark-store.hoon | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pkg/arvo/app/hark-store.hoon b/pkg/arvo/app/hark-store.hoon index f1d3905ac..f7fc61d48 100644 --- a/pkg/arvo/app/hark-store.hoon +++ b/pkg/arvo/app/hark-store.hoon @@ -75,10 +75,12 @@ [%count unread-count] %+ weld %+ turn - (tap-nonempty archive) + %+ scag 5 + (tap-nonempty:ha archive) (timebox-update &) %+ turn - (tap-nonempty notifications) + %+ scag 5 + (tap-nonempty:ha notifications) (timebox-update |) :: ++ timebox-update @@ -86,12 +88,6 @@ |= [time=@da =timebox:store] ^- update:store [%timebox time archived ~(tap by timebox)] - :: - ++ tap-nonempty - |= =notifications:store - ^- (list [@da timebox:store]) - %+ skip (tap:orm notifications) - |=([@da =timebox:store] =(0 ~(wyt by timebox))) -- :: ++ on-peek @@ -104,11 +100,13 @@ (slav %ud i.t.t.path) =/ length=@ud (slav %ud i.t.t.t.path) - :^ ~ ~ %noun + :^ ~ ~ %hark-update !> ^- update:store :- %more %+ turn - (scag length (slag offset (tap:orm notifications))) + %+ scag length + %+ slag offset + (tap-nonempty:ha notifications) |= [time=@da =timebox:store] ^- update:store :^ %timebox time %.n @@ -231,6 +229,12 @@ |_ =bowl:gall +* met ~(. metadata bowl) :: +++ tap-nonempty + |= =notifications:store + ^- (list [@da timebox:store]) + %+ skip (tap:orm notifications) + |=([@da =timebox:store] =(0 ~(wyt by timebox))) +:: ++ merge-notification |= [existing=notification:store new=notification:store] ^- notification:store