diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 145670244e..e811211780 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -3384,8 +3384,9 @@ subscribeUserConnections vr onlyNeeded user = do getContactConns = do ctConns <- withStore_ getUserContactConnIds ctConns' <- mapMaybe contactConnId . filter contactActive <$> withStore_ (`getUserContacts` vr) - unless (S.fromList ctConns == S.fromList ctConns') $ + unless (S.fromList ctConns == S.fromList ctConns') $ do logError $ "getContactConns differ: " <> tshow (ctConns, ctConns') + fail "abandon ship!" pure ctConns -- (map fst cts', M.fromList cts') getUserContactLinkConns :: CM ([ConnId], Map ConnId UserContact) getUserContactLinkConns = do @@ -3397,10 +3398,11 @@ subscribeUserConnections vr onlyNeeded user = do gs <- withStore_ (`getUserGroupMemberConnIds` vr) let mConns = S.fromList (concatMap snd gs) gs' <- withStore_ (`getUserGroups` vr) - let mPairs = concatMap (\(Group _ ms) -> mapMaybe memberConnId (filter (not . memberRemoved) ms)) gs' - let mConns' = S.fromList mPairs - unless (mConns == mConns') $ + let mPairs = concatMap (\(Group _ ms) -> mapMaybe (\m -> (,m) <$> memberConnId m) (filter (not . memberRemoved) ms)) gs' + let mConns' = S.fromList (map fst mPairs) + unless (mConns == mConns') $ do logError $ "getGroupMemberConns differ: " <> tshow (mConns, mConns') + fail "abandon ship!" pure (gs, concatMap snd gs) getSndFileTransferConns :: CM ([ConnId], Map ConnId SndFileTransfer) getSndFileTransferConns = do diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 2ec679555b..3950de2734 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -721,8 +721,6 @@ data ChatResponse | CRCallExtraInfo {user :: User, contact :: Contact, extraInfo :: WebRTCExtraInfo} | CRCallEnded {user :: User, contact :: Contact} | CRCallInvitations {callInvitations :: [RcvCallInvitation]} - | CRUserContactLinkSubscribed -- TODO delete - | CRUserContactLinkSubError {chatError :: ChatError} -- TODO delete | CRNtfTokenStatus {status :: NtfTknStatus} | CRNtfToken {token :: DeviceToken, status :: NtfTknStatus, ntfMode :: NotificationsMode, ntfServer :: NtfServer} | CRNtfMessages {user_ :: Maybe User, connEntity_ :: Maybe ConnectionEntity, msgTs :: Maybe UTCTime, ntfMessages :: [NtfMsgInfo]} diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 5b03d20c04..ebb3086c50 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -283,8 +283,6 @@ responseToView hu@(currentRH, user_) ChatConfig {logLevel, showReactions, showRe CRCallExtraInfo {user = u, contact} -> ttyUser u ["call extra info from " <> ttyContact' contact] CRCallEnded {user = u, contact} -> ttyUser u ["call with " <> ttyContact' contact <> " ended"] CRCallInvitations _ -> [] - CRUserContactLinkSubscribed -> ["Your address is active! To show: " <> highlight' "/sa"] - CRUserContactLinkSubError e -> ["user address error: " <> sShow e, "to delete your address: " <> highlight' "/da"] CRContactConnectionDeleted u PendingContactConnection {pccConnId} -> ttyUser u ["connection :" <> sShow pccConnId <> " deleted"] CRNtfTokenStatus status -> ["device token status: " <> plain (smpEncode status)] CRNtfToken _ status mode srv -> ["device token status: " <> plain (smpEncode status) <> ", notifications mode: " <> plain (strEncode mode) <> ", server: " <> sShow srv] diff --git a/tests/ChatTests/Groups.hs b/tests/ChatTests/Groups.hs index 8cd853ade0..838b6c65dc 100644 --- a/tests/ChatTests/Groups.hs +++ b/tests/ChatTests/Groups.hs @@ -2580,6 +2580,7 @@ testPlanGroupLinkConnecting :: HasCallStack => FilePath -> IO () testPlanGroupLinkConnecting tmp = do -- gLink <- withNewTestChatCfg tmp cfg "alice" aliceProfile $ \alice -> do gLink <- withNewTestChatCfg tmp cfg "alice" aliceProfile $ \a -> withTestOutput a $ \alice -> do + threadDelay 100000 alice ##> "/g team" alice <## "group #team is created" alice <## "to add members use /a team or /create link #team"