Skip to content
Snippets Groups Projects

Add support for temporary messages

Merged akwizgran requested to merge 1585-temporary-messages into master
1 unresolved thread

This branch adds support for marking messages as temporary. Temporary messages are deleted at the next startup (deleting them at shutdown wouldn't be reliable as we don't always shut down cleanly).

When creating a private message with attachments, the messaging client will mark the attachments as temporary until all attachments and the private message have been created, so that no stray attachments are left in the database if we shut down without completing the process.

Messages could alternatively be marked as temporary at the client layer with a metadata flag, but then deleting temporary messages at startup would require the client to iterate over its contact groups, doing a metadata query for each one. Since we eventually plan to add attachment support to other clients, which would increase the number of queries, I thought it was better to move this down to the database and delete all temporary messages with a single query.

Part of #1585 (closed).

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
28 28 import java.util.concurrent.Executor;
29 29
30 30 import static java.util.Arrays.asList;
31 import static java.util.Collections.emptyList;
  • I cleaned up this test in an earlier version of this branch, where the ValidationManager was responsible for deleting temporary messages at startup. I moved that responsibility to the LifecycleManager but thought the cleanup was worth keeping.

  • Please register or sign in to reply
  • Torsten Grote
  • This branch adds support for marking messages as temporary. Temporary messages are deleted at the next startup (deleting them at shutdown wouldn't be reliable as we don't always shut down cleanly).

    Great idea using a temporary flag!

    Messages could alternatively be marked as temporary at the client layer with a metadata flag, but then deleting temporary messages at startup would require the client to iterate over its contact groups, doing a metadata query for each one. Since we eventually plan to add attachment support to other clients, which would increase the number of queries, I thought it was better to move this down to the database and delete all temporary messages with a single query.

    I agree with putting this into the database layer. It is way more elegant and performant there.

    Overall very nice and clear MR. Great work!

  • akwizgran added 1 commit

    added 1 commit

    • 3c8b8c39 - Turn commonly used variables into fields.

    Compare with previous version

  • Torsten Grote enabled an automatic merge when the pipeline for 3c8b8c39 succeeds

    enabled an automatic merge when the pipeline for 3c8b8c39 succeeds

  • merged

  • Torsten Grote mentioned in commit 37f02a40

    mentioned in commit 37f02a40

  • Please register or sign in to reply
    Loading