Add support for temporary messages
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
Activity
changed milestone to %Android 1.3
added ~8 Sponsor 1 ~1 labels
28 28 import java.util.concurrent.Executor; 29 29 30 30 import static java.util.Arrays.asList; 31 import static java.util.Collections.emptyList; - Resolved by akwizgran
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!
enabled an automatic merge when the pipeline for 3c8b8c39 succeeds
mentioned in commit 37f02a40