-
-
Notifications
You must be signed in to change notification settings - Fork 267
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: optimize bulk chat item deletion #1168
Conversation
withStore' $ \db -> updateContactTs db user ct lastItemTs | ||
pure (ct :: Contact) {updatedAt = lastItemTs} | ||
filesInfo <- withStore' $ \db -> getContactFileInfo db user ct | ||
maxItemTs_ <- withStore' $ \db -> getContactMaxItemTs db user ct |
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.
This might be better to choose ID for contacts - for example the one that all chat items before this ID are older than specified. This way we will be deleting in the order of the chat, but some older chat items may remain.
withStore' $ \db -> updateGroupTs db user gInfo lastItemTs | ||
pure (gInfo :: GroupInfo) {updatedAt = lastItemTs} | ||
filesInfo <- withStore' $ \db -> getGroupFileInfo db user gInfo | ||
maxItemTs_ <- withStore' $ \db -> getGroupMaxItemTs db user gInfo |
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 groups it probably should be a pair of timestamp and chat item ID.
SMDRcv -> do | ||
ft@RcvFileTransfer {cancelled} <- withStore (\db -> getRcvFileTransfer db user fileId) | ||
unless cancelled $ cancelRcvFileTransfer user ft | ||
deleteFile :: forall m. ChatMonad m => User -> CIFileInfo -> 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.
Does it still delete the connection somewhere?
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.
yes
No description provided.