mail icon indicating copy to clipboard operation
mail copied to clipboard

Rework Draft Handling - Backend Part

Open miaulalala opened this issue 3 years ago • 3 comments

  • [ ] API Endpoints: PUT, POST to move local message to IMAP, DELETE to delete local and IMAP message (if any).
  • [ ] Provide sync endpoint that syncs local to IMAP drafts box.
    • The other way around - syncing from IMAP to local - should be handled carefully and should not overwrite the local message if it is newer. (Question: is there a timestamp on IMAP draft to compare?)
  • [ ] Provide sync reset endpoint that resets the UID and deletes the associated IMAP draft (to be recreated later as IMAP messages are immutable)
    • this only works if another client doesn't do the same. But then there is nothing we can do and the draft will be duplicated.
  • [ ] Migration to add UID field to the local_messages table when it has been synced
  • [ ] Provide a background job that syncs local drafts to IMAP in case the user closes the window instead of the modal and doesn't come back.
  • [ ] Add attachments support
  • [ ] Handle sending by providing an endpoint to make a draft an outbox message which then also deletes the IMAP draft (if any). let the outbox logic do the rest

miaulalala avatar Aug 24 '22 13:08 miaulalala

Note: the Outbox Backend already handles drafts via an OutboxCreatedEvent that triggers the DeleteDraftListerner. Adjust this class to delete local and IMAP drafts.

miaulalala avatar Aug 24 '22 13:08 miaulalala

Note: We do need a GET for the contents of a draft (unless we load all messages with their content?) something for the fontenders to tell me :)

miaulalala avatar Aug 24 '22 14:08 miaulalala

Note: We do need a GET for the contents of a draft (unless we load all messages with their content?) something for the fontenders to tell me :)

https://github.com/nextcloud/mail/issues/4768#issuecomment-1224352762. MessageService.js::fetchMessage.

ChristophWurst avatar Aug 25 '22 11:08 ChristophWurst

Leftovers

  • [x] T6

ChristophWurst avatar Nov 21 '22 19:11 ChristophWurst

UC3 doesn't work apparently. Local drafts stay local draft forever, the background job does not move idle items to IMAP.

ChristophWurst avatar Jun 26 '23 06:06 ChristophWurst