This commit is contained in:
Alexander Bondarenko
2024-05-30 20:27:07 +03:00
parent 370936aaa1
commit 6311a581cf
3 changed files with 6 additions and 5 deletions
@@ -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`.
-1
View File
@@ -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]}
+1 -1
View File
@@ -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)