sync-engine
sync-engine copied to clipboard
Removing inbox and unread tags simultaneously doesn't mark email as read on IMAP
Steps to reproduce:
- Have a thread consisting of one single unread message in your inbox on an (non-Gmail) IMAP server (e.g. Dovecot)
- Issue the following PUT request to the Nylas thread:
{"remove_tags": ["inbox", "unread"]} - Nylas will queue two actions:
archiveandmark_read. The syncback process will first archive the email as expected, and then try to mark the thread as read. However,inbox.actions.backends.generic.set_remote_unreadstill thinks the email is in the INBOX folder and won't be able to mark the email as read.
Thanks for the report. We're thinking of fixing this by having the syncback process update local UID state when an action completes, which should be straightforward at least for servers that support UIDPLUS. Probably as part of work to also address #143.
Sounds good. I've also run into this problem when archiving a message and then unarchiving it quickly afterwards (on IMAP). The message wouldn't be unarchived.
@thomasst is this still an issue with the new labels+folders API?
This is still an issue and applying tags in succession (I tested the legacy API) leaves Nylas in a permanently inconsistent state.
@thomasst I meant, is it an issue that is also presented in the labels/folders APIs?
Yes. It's still an issue with the latest master. If I PUT {"unread": false, "folder_id": some_folder_id}, then the thread is sometimes not marked as read. If I issue two requests separately (first marking as read and then setting the folder ID), it works fine.