New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: inactive connections/members #4009
base: master
Are you sure you want to change the base?
Conversation
processConnQCONT connEntity conn | ||
lastSharedMsgId <- withStore' $ \db -> getLastItemSharedMsgId db m | ||
forM_ lastSharedMsgId $ \lastMsgId -> do | ||
let conn' = conn {inactive = False} :: Connection | ||
void $ sendDirectMemberMessage conn' (XGrpMsgSkipped lastMsgId) groupId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processConnQCONT
could return updated connection conn'
processConnQCONT :: ConnectionEntity -> Connection -> CM () | ||
processConnQCONT connEntity conn = | ||
when (connInactive conn) $ do | ||
withStore' $ \db -> setConnectionInactive db user conn False | ||
toView $ CRConnectionInactive connEntity False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO could also reset on MSG and RCVD
@@ -4331,11 +4336,17 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage = | |||
OK -> | |||
-- [async agent commands] continuation on receiving OK | |||
when (corrId /= "") $ withCompletedCommand conn agentMsg $ \_cmdData -> pure () | |||
QCONT -> do | |||
processConnQCONT connEntity conn | |||
lastSharedMsgId <- withStore' $ \db -> getLastItemSharedMsgId db m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- for super peer it may be better to instead search via
msg_deliveries
table, to account for forwarded group messages (seeforwardMsg_
)- may have to additionally store original shared msg id (currently shared_msg_id is for the forwarded message itself)
- or populate
group_snd_item_statuses
? - store additional data?
SELECT chat_item_id | ||
FROM group_snd_item_statuses | ||
WHERE group_member_id = ? | ||
AND (group_snd_item_status LIKE 'snd_sent%' OR group_snd_item_status LIKE 'snd_rcvd%') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could store "tags" to avoid LIKE
xGrpMsgSkipped :: GroupInfo -> GroupMember -> SharedMsgId -> RcvMessage -> UTCTime -> CM () | ||
xGrpMsgSkipped _gInfo _m _sharedMsgId _msg _brokerTs = do | ||
-- TODO can request delivery starting with _sharedMsgId here | ||
pure () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originally had a new type of group event chat item created here, but removed it as there's already integrity error item created so it seems unnecessary. Maybe should add it back, with it saying "member continued delivery for you"
@@ -6470,7 +6500,7 @@ memberSendAction :: ChatMsgEvent e -> [GroupMember] -> GroupMember -> Maybe Memb | |||
memberSendAction chatMsgEvent members m@GroupMember {invitedByGroupMemberId} = case memberConn m of | |||
Nothing -> pendingOrForwarded | |||
Just conn@Connection {connStatus} | |||
| connDisabled conn || connStatus == ConnDeleted -> Nothing | |||
| connDisabled conn || connInactive conn || connStatus == ConnDeleted -> Nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may apply to contact connections as well, decided against it and only track info for them
No description provided.