diff --git a/docs/rfcs/2024-05-28-optimized-subscription.md b/docs/rfcs/2024-05-28-optimized-subscription.md index 02d56b0ff8..b8e92312d6 100644 --- a/docs/rfcs/2024-05-28-optimized-subscription.md +++ b/docs/rfcs/2024-05-28-optimized-subscription.md @@ -18,11 +18,13 @@ Successful results are communicated with a new `UP srv conns` message emitted fr `reconnectSMPClient` should stop sending UPs to prevent double processing of the same result. The `okConns` membership test it currently uses is the same "did not belong to an active connection" that the batch result would use. -Sending results with UP allows to reduce summary responses to a generic structure with counters so no entity data would be needed for CLI here: +Sending results with UP allows to reduce summary responses to a bunch of counters so no entity data would be needed for CLI here: ```haskell -| CRConnectionSubSummary {user :: User, okSubs :: Int, errSubs :: Int} -- XXX: add label :: Text ? -| CRGroupSubSummary {user :: User, groupName :: GroupName, okSubs :: Int, errSubs :: Int} -- XXX: needs group name as group reports +| CRContactSubSummary {user :: User, okSubs :: Int, errSubs :: Int} +| CRUserGroupLinksSubSummary {user :: User, okSubs :: Int, errSubs :: Int} +| CRMemberSubSummary {user :: User, okSubs :: Int, errSubs :: Int} +| CRPendingSubSummary {user :: User, okSubs :: Int, errSubs :: Int} ``` Subscription errors are reported to API as `CRNetworkStatuses` as ususal, but the active subs are removed from the list as they are already handled by `UP`. diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 383c2a5fb4..0e1afe5774 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -671,7 +671,6 @@ data ChatResponse | CRContactsSubscribed {server :: SMPServer, contactRefs :: [ContactRef]} | CRContactSubSummary {user :: User, okSubs :: Int, errSubs :: Int} | CRContactSubError {user :: User, contactName :: ContactName, chatError :: ChatError} - -- | CRUserContactSubSummary {user :: User, userContactSubscriptions :: [UserContactSubStatus]} -- XXX: weirs status/subSummary/subError hybrid | CRUserAddrSubStatus {user :: User, userContactError :: Maybe ChatError} | CRUserGroupLinksSubSummary {user :: User, okSubs :: Int, errSubs :: Int} | CRNetworkStatus {networkStatus :: NetworkStatus, connections :: [AgentConnId]} diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index cee4ccae5b..04c5aab175 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -19,7 +19,7 @@ import qualified Data.ByteString.Lazy.Char8 as LB import Data.Char (isSpace, toUpper) import Data.Function (on) import Data.Int (Int64) -import Data.List (groupBy, intercalate, intersperse, partition, sortOn) +import Data.List (groupBy, intercalate, intersperse, sortOn) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as L import Data.Map.Strict (Map)