Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7fa1ee4
groups: subscription lifecycle wip
mikolajpp Dec 8, 2025
5bd95e2
Merge branch 'm/spinster' into mp/groups-sub-lifecycle
mikolajpp Dec 9, 2025
61d7e7e
channels: refactor types versioning
mikolajpp Dec 10, 2025
2b42e04
channels: restructure version cores
mikolajpp Dec 11, 2025
48eea32
channels: fix tests
mikolajpp Dec 12, 2025
d4cb2e9
Merge branch 'mp/channels-versioning' into mp/groups-sub-lifecycle
mikolajpp Dec 12, 2025
5816993
channels: subscriptions lifecycle wip
mikolajpp Dec 15, 2025
3e13aeb
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Dec 15, 2025
323bd0f
channels: implement subscriptions lifecycle
mikolajpp Dec 15, 2025
b1169f9
channels: upgrade protocols; implement new JSON encoders
mikolajpp Dec 16, 2025
c60ac8a
Subscriptions lifecycles work in channels and groups
mikolajpp Dec 16, 2025
105c63c
channels: various fixes
mikolajpp Dec 16, 2025
a04b1b7
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Dec 16, 2025
b91e5ad
Subscriptions lifecycle: various fixes
mikolajpp Dec 17, 2025
482862f
channels: fix unit tests
mikolajpp Dec 17, 2025
d5bb4ce
Subscriptions lifecycle: remove debug prints
mikolajpp Dec 17, 2025
445641b
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Dec 17, 2025
16919b4
docket: restore correct version
mikolajpp Dec 17, 2025
3215ef3
Subscriptions lifecycle: various fixes
mikolajpp Dec 17, 2025
03f5bcb
Subscriptions lifecycle: various fixes
mikolajpp Dec 17, 2025
59cdde0
reel: fix unit tests
mikolajpp Dec 17, 2025
adfbd30
Subscriptions lifecycle: fixes following PR review
mikolajpp Dec 19, 2025
ad9449b
channels: maintain %watch connection in +ca-start-updates
mikolajpp Dec 19, 2025
dad26f6
channels: relax %channel-response-4 discipline
mikolajpp Dec 19, 2025
eaca084
groups: minor fixes
mikolajpp Dec 19, 2025
ad3c8ca
channels: add explanatory comment
mikolajpp Dec 19, 2025
d90682c
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Jan 8, 2026
529df04
channels: track connection status for all subscriptions
mikolajpp Jan 8, 2026
2ce2adb
channels: fix unit tests
mikolajpp Jan 9, 2026
17a0b16
Subscription lifecycles: refactor sub management in channels
mikolajpp Jan 13, 2026
ae76f9e
Subscriptions lifecycle: prepare for develop merge
mikolajpp Feb 3, 2026
6760aac
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Feb 3, 2026
6094830
groups: fix unit tests
mikolajpp Feb 3, 2026
bebfb29
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Feb 4, 2026
c1e5906
Subscription lifecycles: post develop merge fixes
mikolajpp Feb 4, 2026
fcdd4f4
groups: fix migration logic
mikolajpp Feb 5, 2026
74c370c
Merge branch 'develop' into mp/groups-sub-lifecycle
mikolajpp Feb 12, 2026
b4e1553
tests: remove spurious sleep
mikolajpp Feb 12, 2026
8f2a6f6
tests: increase the aqua test runner timeout
mikolajpp Feb 12, 2026
cc9c674
activity: fix crashes on initial dm
mikolajpp Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 59 additions & 28 deletions desk/app/channels-server.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:: this is the server-side from which /app/channels gets its data.
::
/- c=channels, cv=channels-ver, g=groups, gv=groups-ver, h=hooks, m=meta
/+ utils=channel-utils, imp=import-aid, em=emojimart
/+ utils=channel-utils, ccv=channel-conv, imp=import-aid, em=emojimart
/+ default-agent, verb, dbug,
neg=negotiate, discipline, logs
/+ hj=hooks-json
Expand All @@ -14,6 +14,7 @@
/% m-channel-said-1 %channel-said-1
/% m-channel-said-2 %channel-said-2
/% m-channel-update %channel-update
/% m-channel-error %channel-error
/% m-hook-channel-preview %hook-channel-preview
/% m-hook-full %hook-full
/% m-hook-response-0 %hook-response-0
Expand All @@ -28,16 +29,17 @@
:+ %channel-said-1 | -:!>(*vale:m-channel-said-1)
:+ %channel-said-2 | -:!>(*vale:m-channel-said-2)
:+ %channel-update | -:!>(*vale:m-channel-update)
:+ %channel-error | -:!>(*vale:m-channel-error)
:+ %hook-channel-preview | -:!>(*vale:m-hook-channel-preview)
:+ %hook-full | -:!>(*vale:m-hook-full)
:+ %hook-response-0 | -:!>(*vale:m-hook-response-0)
:+ %hook-template | -:!>(*vale:m-hook-template)
==
:: facts
::
:~ [/$/$/checkpoint %channel-checkpoint ~]
[/$/$/create %channel-update ~]
[/$/$/updates %channel-update %channel-logs ~]
:~ [/$/$/checkpoint %channel-checkpoint %channel-error ~]
[/$/$/create %channel-update %channel-error ~]
[/$/$/updates %channel-update %channel-logs %channel-error ~]
[/said %channel-said-2 %channel-said-1 %channel-denied ~]
::
[/v0/hooks %hook-response-0 ~]
Expand All @@ -52,8 +54,8 @@
::
%- %- agent:neg
:+ notify=|
[~.channels^%3 ~ ~]
(my %groups^[~.groups^%2 ~ ~] ~)
[~.channels^%4 ~ ~]
(my %groups^[~.groups^%3 ~ ~] ~)
%- agent:dbug
%^ verb | %warn
::
Expand All @@ -62,8 +64,8 @@
|%
+$ card card:agent:gall
+$ current-state
$: %13
=v-channels:v9:cv
$: %14
=v-channels:v10:cv
=hooks:h
=pimp:imp
==
Expand Down Expand Up @@ -160,12 +162,14 @@
=? old ?=(%10 -.old) (state-10-to-11 old)
=? old ?=(%11 -.old) (state-11-to-12 old)
=? old ?=(%12 -.old) (state-12-to-13 old)
?> ?=(%13 -.old)
=? old ?=(%13 -.old) (state-13-to-14 old)
?> ?=(%14 -.old)
=. state old
inflate-io
::
+$ versioned-state
$% state-13
$% state-14
state-13
state-12
state-11
state-10
Expand All @@ -180,7 +184,13 @@
state-1
state-0
==
+$ state-13 current-state
+$ state-14 current-state
+$ state-13
$: %13
=v-channels:v9:cv
=hooks:h
=pimp:imp
==
+$ state-12 _%*(. *state-13 - %12)
+$ state-11 _%*(. *state-12 - %11)
+$ state-10
Expand Down Expand Up @@ -213,6 +223,12 @@
=pimp:imp
==
::
++ state-13-to-14
|= s=state-13
~> %spin.['state-13-to-14']
^- state-14
s(- %14, v-channels (~(run by v-channels.s) v10:v-channel:v9:ccv))
::
++ state-12-to-13
|= s=state-12
~> %spin.['state-12-to-13']
Expand Down Expand Up @@ -307,10 +323,10 @@
++ v-channel-2
|^ ,[global:v-channel:v7:cv local]
+$ local
$: =net:c
$: =net:v7:cv
=log:v7:cv
=remark:c
=window:v-channel:c
=remark:v7:cv
=window:v-channel:v7:cv
=future:v-channel:v7:cv
==
--
Expand Down Expand Up @@ -340,7 +356,7 @@
==
+$ window window:v-channel:c
+$ future [=window diffs=(jug id-post:c u-post-1)]
+$ local [=net:c log=log-1 =remark:c =window =future]
+$ local [=net:v7:cv log=log-1 =remark:v7:cv =window =future]
--
+$ log-1 ((mop time u-channel-1) lte)
++ log-on-1 ((on time u-channel-1) lte)
Expand Down Expand Up @@ -423,7 +439,7 @@
|^ ,[global:v-channel-1 local]
+$ window window:v-channel:c
+$ future [=window diffs=(jug id-post:c u-post-1)]
+$ local [=net:c log=log-1 remark=remark-0 =window =future]
+$ local [=net:v7:cv log=log-1 remark=remark-0 =window =future]
--
+$ remark-0 [last-read=time watching=_| unread-threads=(set id-post:c)]
::
Expand Down Expand Up @@ -645,29 +661,37 @@
ca-abet:ca-watch-create:(ca-abed:ca-core nest)
::
[=kind:c name=@ %updates ~]
?. (~(has by v-channels) kind.pole our.bowl name.pole)
ca-abet:(ca-give-conn-error:ca-core %not-found)
=/ ca (ca-abed:ca-core kind.pole our.bowl name.pole)
?. (can-read:ca-perms:ca src.bowl)
~|(%permission-denied !!)
ca-abet:(ca-give-conn-error:ca-core %not-authorized)
cor
::
[=kind:c name=@ %updates after=@ ~]
=< ca-abet
%- ca-watch-updates:(ca-abed:ca-core kind.pole our.bowl name.pole)
(slav %da after.pole)
?. (~(has by v-channels) kind.pole our.bowl name.pole)
ca-abet:(ca-give-conn-error:ca-core %not-found)
=/ ca (ca-abed:ca-core kind.pole our.bowl name.pole)
ca-abet:(ca-watch-updates:ca (slav %da after.pole))
::
[=kind:c name=@ %checkpoint %time-range from=@ ~]
=< ca-abet
%- ca-watch-checkpoint:(ca-abed:ca-core kind.pole our.bowl name.pole)
[(slav %da from.pole) ~]
?. (~(has by v-channels) kind.pole our.bowl name.pole)
ca-abet:(ca-give-conn-error:ca-core %not-found)
=/ ca (ca-abed:ca-core kind.pole our.bowl name.pole)
ca-abet:(ca-watch-checkpoint:ca (slav %da from.pole) ~)
::
[=kind:c name=@ %checkpoint %time-range from=@ to=@ ~]
?. (~(has by v-channels) kind.pole our.bowl name.pole)
ca-abet:(ca-give-conn-error:ca-core %not-found)
=< ca-abet
%^ ca-watch-checkpoint:(ca-abed:ca-core kind.pole our.bowl name.pole)
(slav %da from.pole)
~
(slav %da to.pole)
::
[=kind:c name=@ %checkpoint %before n=@ud ~]
?. (~(has by v-channels) kind.pole our.bowl name.pole)
ca-abet:(ca-give-conn-error:ca-core %not-found)
=< ca-abet
%- ca-watch-checkpoint-page:(ca-abed:ca-core kind.pole our.bowl name.pole)
(slav %ud n.pole)
Expand Down Expand Up @@ -718,7 +742,7 @@
((slog tank u.p.sign) cor)
::
%fact
(take-groups !<(r-groups:v9:gv q.cage.sign))
(take-groups !<(r-groups:v10:gv q.cage.sign))
==
::
[%migrate ~]
Expand Down Expand Up @@ -769,7 +793,7 @@
:: +take-groups: process group update
::
++ take-groups
|= =r-groups:v9:gv
|= =r-groups:v10:gv
~> %spin.['take-groups']
=/ affected=(list nest:c)
%+ murn ~(tap by v-channels)
Expand Down Expand Up @@ -870,7 +894,7 @@
~> %spin.['ca-watch-updates']
^+ ca-core
?. (can-read:ca-perms src.bowl)
~|(%permission-denied !!)
(ca-give-conn-error %not-authorized)
=/ =log:c (lot:log-on:c log.channel `da ~)
=. ca-core (give %fact ~ %channel-logs !>(log))
ca-core
Expand All @@ -880,7 +904,7 @@
~> %spin.['ca-watch-checkpoint']
^+ ca-core
?. (can-read:ca-perms src.bowl)
~|(%permission-denied !!)
(ca-give-conn-error %not-authorized)
=/ posts=v-posts:c (lot:on-v-posts:c posts.channel `from to)
=/ chk=u-checkpoint:c -.channel(posts posts)
=. ca-core (give %fact ~ %channel-checkpoint !>(chk))
Expand All @@ -891,7 +915,7 @@
~> %spin.['ca-watch-checkpoint-page']
^+ ca-core
?. (can-read:ca-perms src.bowl)
~|(%permission-denied !!)
(ca-give-conn-error %not-authorized)
=/ posts=v-posts:c (gas:on-v-posts:c *v-posts:c (bat:mo-v-posts:c posts.channel ~ n))
=/ chk=u-checkpoint:c -.channel(posts posts)
=. ca-core (give %fact ~ %channel-checkpoint !>(chk))
Expand Down Expand Up @@ -1281,6 +1305,13 @@
ca-core
(give %fact paths %channel-update !>(update))
::
++ ca-give-conn-error
|= err=conn-error:c
^+ ca-core
=. ca-core
(give %fact ~ channel-error+!>(err))
(give %kick ~ ~)
::
++ ca-subscriptions
~> %spin.['ca-subscriptions']
^- (set [ship path])
Expand Down
Loading