From a124c747b74f740ce00f4569b9e8669e56f1f958 Mon Sep 17 00:00:00 2001 From: fang Date: Tue, 15 Dec 2020 16:19:39 +0100 Subject: [PATCH 1/2] drum: update app index early when unlinking The added logic also happens in +se-drop, which will get called by +se-abet if we did unlink an application. But +se-agon depends on the index being sane, and may be called between +se-klin and +se-abet. --- pkg/arvo/lib/hood/drum.hoon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index b3230285e0..6a99456c7c 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -564,7 +564,12 @@ :: ++ se-klin :: disconnect app |= gyl=gill:gall - +>(eel (~(del in eel) gyl)) + =/ gil=(unit gill:gall) se-agon + =. eel (~(del in eel) gyl) + ?~ gil +>.$ + ?: =(gyl u.gil) + +>.$(inx 0) + (se-alas u.gil) :: ++ se-link :: connect to app |= gyl=gill:gall From f285c7954ef78d245cb17abca598a4626d61ec73 Mon Sep 17 00:00:00 2001 From: fang Date: Tue, 15 Dec 2020 16:56:47 +0100 Subject: [PATCH 2/2] sole: add %bye effect for closing the session This lets applications suggest to the client that they should gracefully unsubscribe from the session. Arguably this might be accomplished by %kick-ing the client and then crashing on their subsequent resubscribe, but this requires tracking their sole session id and has less semantic clarity on what's happening. --- pkg/arvo/lib/hood/drum.hoon | 1 + pkg/arvo/mar/sole/effect.hoon | 2 +- pkg/arvo/sur/sole.hoon | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index 6a99456c7c..e3c33eda90 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -793,6 +793,7 @@ ?- fec [%bel *] ta-bel [%blk *] +> + [%bye *] +>(..ta (se-klin gyl)) [%clr *] +>(..ta (se-blit fec)) [%det *] (ta-got +.fec) [%err *] (ta-err p.fec) diff --git a/pkg/arvo/mar/sole/effect.hoon b/pkg/arvo/mar/sole/effect.hoon index 6d4ae80748..7b1f7477b3 100644 --- a/pkg/arvo/mar/sole/effect.hoon +++ b/pkg/arvo/mar/sole/effect.hoon @@ -75,7 +75,7 @@ info+(tape ~(ram re tank)) == :: - ?(%bel %clr %nex) + ?(%bel %clr %nex %bye) (frond %act %s -.sef) == -- diff --git a/pkg/arvo/sur/sole.hoon b/pkg/arvo/sur/sole.hoon index fa21c96ee2..e942bccb87 100644 --- a/pkg/arvo/sur/sole.hoon +++ b/pkg/arvo/sur/sole.hoon @@ -30,6 +30,7 @@ +$ sole-effect :: app to sole $% [%bel ~] :: beep [%blk p=@ud q=@c] :: blink+match char at + [%bye ~] :: close session [%clr ~] :: clear screen [%det sole-change] :: edit command [%err p=@ud] :: error point