hark: final pass for bugs

This commit is contained in:
Liam Fitzgerald 2020-10-28 15:52:59 +10:00
parent d89ccffb62
commit cf4f0f302e
6 changed files with 30 additions and 16 deletions

View File

@ -144,9 +144,7 @@
(need (peek-metadata:met %graph group resource.q.update)) (need (peek-metadata:met %graph group resource.q.update))
=* rid resource.q.update =* rid resource.q.update
=+ (scry ,mark=(unit mark) /gx/graph-store/graph-mark/(scot %p entity.rid)/[name.rid]/noun) =+ (scry ,mark=(unit mark) /gx/graph-store/graph-mark/(scot %p entity.rid)/[name.rid]/noun)
?~ mark =+ (scry ,=tube:clay /cc/[q.byk.bowl]/[(fall mark %graph-validator-link)]/notification-kind)
[~ state]
=+ (scry ,=tube:clay /cc/[q.byk.bowl]/[u.mark]/notification-kind)
^- (quip card _state) ^- (quip card _state)
=/ nodes=(list [p=index:graph-store q=node:graph-store]) =/ nodes=(list [p=index:graph-store q=node:graph-store])
~(tap by nodes.q.update) ~(tap by nodes.q.update)
@ -189,7 +187,9 @@
?~ contents %.n ?~ contents %.n
?. ?=(%text -.i.contents) ?. ?=(%text -.i.contents)
$(contents t.contents) $(contents t.contents)
?^ (find (trip text.i.contents) (scow %p our.bowl)) =/ res
(find (scow %p our.bowl) (trip text.i.contents))
?^ res
%.y %.y
$(contents t.contents) $(contents t.contents)
:: ::

View File

@ -147,8 +147,11 @@
(merge-notification:ha u.existing-notif notification) (merge-notification:ha u.existing-notif notification)
=/ new-timebox=timebox:store =/ new-timebox=timebox:store
(~(put by timebox) index new) (~(put by timebox) index new)
:- ~ :: (give:ha [/updates]~ %add index notification) :- (give:ha [/updates]~ %added last-seen index new)
state(notifications (put:orm notifications last-seen new-timebox)) %_ state
notifications (put:orm notifications last-seen new-timebox)
unread-count +(unread-count)
==
:: ::
++ do-archive ++ do-archive
|= [time=@da =index:store] |= [time=@da =index:store]
@ -161,6 +164,7 @@
(~(del by timebox) index) (~(del by timebox) index)
:- (give:ha [/updates]~ %archive time index) :- (give:ha [/updates]~ %archive time index)
%_ state %_ state
unread-count (dec unread-count)
:: ::
notifications notifications
(put:orm notifications time new-timebox) (put:orm notifications time new-timebox)
@ -176,13 +180,19 @@
|= [time=@da =index:store] |= [time=@da =index:store]
^- (quip card _state) ^- (quip card _state)
:- (give:ha [/updates]~ %read time index) :- (give:ha [/updates]~ %read time index)
state(notifications (change-read-status:ha time index %.y)) %_ state
unread-count (dec unread-count)
notifications (change-read-status:ha time index %.y)
==
:: ::
++ unread ++ unread
|= [time=@da =index:store] |= [time=@da =index:store]
^- (quip card _state) ^- (quip card _state)
:- (give:ha [/updates]~ %unread time index) :- (give:ha [/updates]~ %unread time index)
state(notifications (change-read-status:ha time index %.n)) %_ state
unread-count +(unread-count)
notifications (change-read-status:ha time index %.n)
==
:: ::
++ seen ++ seen
^- (quip card _state) ^- (quip card _state)
@ -233,9 +243,6 @@
:: ::
++ change-read-status ++ change-read-status
|= [time=@da =index:store read=?] |= [time=@da =index:store read=?]
~& `@ud`time
~& index
~& ;;((list @ud) (key-orm notifications))
^+ notifications ^+ notifications
%^ jub-orm notifications time %^ jub-orm notifications time
|= =timebox:store |= =timebox:store

View File

@ -23,8 +23,6 @@
%- of %- of
:~ listen+dejs-path:resource :~ listen+dejs-path:resource
ignore+dejs-path:resource ignore+dejs-path:resource
listen-indices+graph-indices
ignore-indices+graph-indices
set-mentions+bo set-mentions+bo
set-watch-on-self+bo set-watch-on-self+bo
== ==
@ -48,7 +46,6 @@
%set-watch-on-self b+watch-on-self.act %set-watch-on-self b+watch-on-self.act
%set-mentions b+mentions.act %set-mentions b+mentions.act
?(%listen %ignore) s+(enjs-path:resource graph.act) ?(%listen %ignore) s+(enjs-path:resource graph.act)
?(%listen-indices %ignore-indices) (graph-indices +.act)
== ==
:: ::
++ update ++ update
@ -61,7 +58,6 @@
:~ 'watchOnSelf'^b+watch-on-self.upd :~ 'watchOnSelf'^b+watch-on-self.upd
'mentions'^b+mentions.upd 'mentions'^b+mentions.upd
watching+a+(turn ~(tap in watching.upd) |=(r=resource s+(enjs-path:resource r))) watching+a+(turn ~(tap in watching.upd) |=(r=resource s+(enjs-path:resource r)))
'watchingIndices'^a+(turn ~(tap by watching-indices.upd) graph-indices)
== ==
-- --
-- --

View File

@ -68,6 +68,7 @@
|^ |^
%+ frond -.upd %+ frond -.upd
?+ -.upd a+~ ?+ -.upd a+~
%added (added +.upd)
%timebox (timebox +.upd) %timebox (timebox +.upd)
%set-dnd b+dnd.upd %set-dnd b+dnd.upd
%count (numb count.upd) %count (numb count.upd)
@ -76,6 +77,15 @@
(notif-ref +.upd) (notif-ref +.upd)
== ==
:: ::
++ added
|= [tim=@da idx=^index not=^notification]
^- json
%- pairs
:~ time+s+(scot %ud tim)
index+(index idx)
notification+(notification not)
==
::
++ notif-ref ++ notif-ref
|= [tim=@da idx=^index] |= [tim=@da idx=^index]
^- json ^- json

View File

@ -6,7 +6,7 @@
++ noun upd ++ noun upd
++ json ++ json
%+ frond:enjs:format %+ frond:enjs:format
%hark-graph-hook-update %hark-group-hook-update
(update:enjs upd) (update:enjs upd)
-- --
++ grab ++ grab

View File

@ -42,6 +42,7 @@
+$ update +$ update
$% action $% action
[%more =(list update)] [%more =(list update)]
[%added time=@da =index =notification]
[%timebox time=@da archived=? =(list [index notification])] [%timebox time=@da archived=? =(list [index notification])]
[%count count=@ud] [%count count=@ud]
== ==