8b5eb04b07
## Context We would like to start leveraging more messageFolders during messageSync which would allow users to select folders they want to sync on their mailbox. MessageFolder is an abstraction that means folder for Microsoft, labels for Gmail, not supported for IMAP. ## What 1) We do not aim to build a FE now but we would like to take it into a consideration if they have been modified through API. So **out of scope** 2) MessageFolders will be synced regularly from Gmail, Microsoft. This is currently partially done and improving it is **out of scope** 3) Change: we were having two synchronization mechanism so far: FULL_SYNC (first time, or when no cursor is present) and PARTIAL_SYNC (when we have a cursor, we can fetch the diff since the last pull). This Full vs Partial mode was a high level concept. We now think it's an driver implementation detail (and can be inferred from the existence of a cursor). Why making this change now: as we are trying to pull several folders, a folder could need a full sync if it had no cursor, and another a partial if it has one. It does not make sense anymore to have this full vs partial difference at MessageChannel level 4) Once we are sure this work, we can start syncing different folders on Gmail side (the case for the user it to be able to fetch Promotion label) ## Implementation strategy 1) Re-use PartialMessageList implementation / API and rename it to MessageList at it's more complete 2) re-use driver level fullMessageList methods and call them messageListWithoutCursor 3) make sure that these method are folder specific ## Tests ### Gmail - Fresh fetch (without cursor): OK - Message import: OK - Additional fetch (with messageChannel cursor): OK ### Microsoft - Fresh fetch (without cursor): OK - Message import: OK - Additional fetch (with messageChannel cursor): OK ### Imap - Fresh fetch (without cursor): OK - Message import: OK - Additional fetch (with messageChannel cursor): OK