graph-store: subscribers always keep minimal logs
Transposes the change in so
that subscribers always keep the minimum possible logs.
%tags ~|('cannot send %tags as poke' !!)
%tag-queries ~|('cannot send %tag-queries as poke' !!)
==
+ ++ put-update-log
+ |= [=resource:store =update-log:store =time =logged-update:store]
+ ^- update-log:store
+ ?: =(our.bowl entity.resource)
+ (put:orm-log update-log time logged-update)
+ %+ gas:orm-log *update-log:store
+ :~ (need (pry:orm-log update-log))
+ [time logged-update]
+ ==
::
++ add-graph
|= $: =time
?> is-valid
=/ =update-log:store (~(got by update-logs) resource)
=. update-log
- (put:orm-log update-log time [time [%add-nodes resource nodes]])
+ (put-update-log resource update-log time [time %add-nodes resource nodes])
::
:- (give [/updates]~ [%add-nodes resource nodes])
%_ state
(~(got by graphs) resource)
=/ =update-log:store (~(got by update-logs) resource)
=. update-log
- (put:orm-log update-log time [time [%remove-posts resource indices]])
+ %^ put-update-log resource
+ update-log
+ [time time %remove-posts resource indices]
:- (give [/updates]~ [%remove-posts resource indices])
%_ state
update-logs (~(put by update-logs) resource update-log)
(~(got by graphs) resource)
=/ =update-log:store (~(got by update-logs) resource)
=. update-log
- (put:orm-log update-log time [time [%add-signatures uid signatures]])
- ::
+ %^ put-update-log resource
+ update-log
+ [time time %add-signatures uid signatures]
:- (give [/updates]~ [%add-signatures uid signatures])
%_ state
update-logs (~(put by update-logs) resource update-log)
(~(got by graphs) resource)
=/ =update-log:store (~(got by update-logs) resource)
=. update-log
- %^ put:orm-log update-log
- time
- [time [%remove-signatures uid signatures]]
+ %^ put-update-log resource
+ update-log
+ [time time %remove-signatures uid signatures]
::
:- (give [/updates]~ [%remove-signatures uid signatures])
%_ state
