Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: batch db operations for group leave and delete #3807

Merged
merged 11 commits into from Feb 26, 2024

Conversation

spaced4ndy
Copy link
Contributor

@spaced4ndy spaced4ndy commented Feb 14, 2024

Changes in this PR:

  • batches db operations for connection updates when deleting member connections
  • batches db operations for unused contact deletion
  • reworks bulk file cancellation and deletion
    • cancellation and deletion are split into different functions, some call sites only do cancellation (e.g. leave group), some others only do deletion (e.g. clear notes)
    • leave group api now does file cancellation
    • file cancellation db operations are batched in steps (getFileTransfer, update files to cancelled, set xftp files "deleted" flags)
    • other call sites in addition to group leave and delete also use reworked approach: clear chat, user deletion, chat item expiration, some call sites deleting only a single file (e.g. chat item deletion)
    • some other call sites deleting only a single file continue to use specialized functions such as cancelRcvFileTransfer: SMP file connections, cancel file api (the latter makes more detailed checks and some additional actions e.g. to reset file for re-download); can be further simplified if SMP and inline files protocols are deprecated
    • in batch cancellation FileChunkCancel is no longer sent for SMP and inline files for simplicity (as they are no longer in use and may be deprecated soon)

@spaced4ndy spaced4ndy marked this pull request as ready for review February 14, 2024 13:11
@spaced4ndy spaced4ndy marked this pull request as draft February 14, 2024 13:54
@spaced4ndy spaced4ndy marked this pull request as ready for review February 16, 2024 10:10
src/Simplex/Chat.hs Outdated Show resolved Hide resolved
@spaced4ndy spaced4ndy marked this pull request as draft February 16, 2024 14:49
@spaced4ndy spaced4ndy marked this pull request as ready for review February 22, 2024 10:08
src/Simplex/Chat.hs Outdated Show resolved Hide resolved
dpwiz
dpwiz previously approved these changes Feb 22, 2024
src/Simplex/Chat.hs Outdated Show resolved Hide resolved
src/Simplex/Chat.hs Outdated Show resolved Hide resolved
src/Simplex/Chat.hs Outdated Show resolved Hide resolved
@spaced4ndy spaced4ndy merged commit 51a2e09 into master Feb 26, 2024
4 of 7 checks passed
@spaced4ndy spaced4ndy deleted the f/batch-leave-delete branch February 26, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants