mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-12 02:58:20 +08:00
359e32282f
Summary: We've been syncing drafts messages but not the drafts flag in K2, making them appear in Edgehill as regular old messages. This commit makes K2 sync the drafts flag, and also correctly label folders called "Drafts" with the 'drafts' role. Because 2-way syncing of drafts is very complex and error-prone since you need to add new drafts and delete the old ones on every update, and we reaally don't want to do things like create multiplying draft copies or accidentally lose a draft someone started composing elsewhere, we simply exclude messages marked as drafts from being serialized to Edgehill through the delta stream for now. This removes the confusing behaviour and also sets a better stage for completing drafts sync later. Eventually we will also want to add functionality to allow users to select their drafts folder, but for now this code does the right thing in many more cases. While investigating this behaviour, I also discovered a bug we've never seen before where Gmail isn't applying the \Draft flag to draft messages, no matter which folder we fetch them from. :-/ This is very unfortunate and there's no way for us to work around it other than to fetch messages in the Drafts folder and manually apply the flag locally, since "drafts" is not a label in Gmail, only another IMAP folder. Brandon Long from the Gmail team says that this is because they've had problems with clients which sync drafts, so the Gmail web client and mobile apps do not set the \Draft flag on drafts. (I don't get how this solves their problem, but okay.) Let's solve the issue on Gmail if it comes up by user demand—should be relatively straightforward to implement, but it adds sync work & complexity. Fixes T7593 Test Plan: manual Reviewers: halla, juan Reviewed By: juan Maniphest Tasks: T7593 Differential Revision: https://phab.nylas.com/D3749 |
||
---|---|---|
.. | ||
src | ||
index.js | ||
package.json |