MailNews:Better Faster IMAP Plan: Difference between revisions

Line 266: Line 266:


* Requirement #1.1 can be implemented by simply enabling AutoSyncOfflineStores option and putting the selected folder into offline mode.
* Requirement #1.1 can be implemented by simply enabling AutoSyncOfflineStores option and putting the selected folder into offline mode.
* Requirement #1.2 can be implemented with the help of the following new components:
* Requirement #1.2 can be implemented with the help of the following new components (please note that these are conceptual rather than physical):
** <b>Operation Queue</b>; Its main duty is to serialize access to imap protocol queue, and prioritize requested online operations. The components mentioned below are the consumer of this one.
** <b>Priority Queue</b>; Its main duty is to serialize access to imap protocol queue, and prioritize download and playback requests.
** <b>Message download manager</b>; Main duties are to coordinate partial downloads, to make strategy-based decisions to prioritize messages. In the context of this component we need to implement PARTIAL FETCH commands in imap protocol level. The existing code fetches the mime structure of the message, and looks at the types of all the parts. If a message has parts TB doesn't know how to render inline (e.g., a .zip file, or a .doc or a .pdf), it fetches the body, and the parts TB knows how to display inline separately, and doesn't fetch the parts that TB can't render inline. We can definitely leverage this feature.
** <b>Message download manager</b>; Main duties are to coordinate partial downloads, and to make strategy-based decisions to prioritize messages. In the context of this component we need to implement PARTIAL FETCH commands in imap protocol level. The existing code fetches the mime structure of the message, and looks at the types of all the parts. If a message has parts TB doesn't know how to render inline (e.g., a .zip file, or a .doc or a .pdf), it fetches the body, and the parts TB knows how to display inline separately, and doesn't fetch the parts that TB can't render inline. We can definitely leverage this feature.
** <b>Operation playback manager</b>; To playback pending operations on the server and handling errors gracefully. In other word activating offline operation state machine when required. This component is partially implemented as part of <i>Offline operation playback</i> feature.  
** <b>Playback manager</b>; To playback pending offline operations on the server and handling errors gracefully. In other word activating offline operation state machine when required. This component is partially implemented as part of <i>Offline operation playback</i> feature.  
* Requirement #1.3 is a matter of adding this option into mailnews.js
* Requirement #1.3 is a matter of adding this option into mailnews.js
* Requirement #2 same as #1.2
* Requirement #2 same as #1.2
* Requirement #4 can be implemented by storing all operations locally, and playing them back using <i>Operation playback manager</i>. To store the operations locally TB can be put to the following states (''see Existing Behavior section''):
* Requirement #4 can be implemented by storing all operations locally, and playing them back using <i>Playback manager</i>. To store the operations locally TB can be put to the following states (''see Existing Behavior section''):
*** <i>Copying/Moving an IMAP message</i>: one of the states 2, 8, 11, 12  
*** <i>Copying/Moving an IMAP message</i>: one of the states 2, 8, 11, 12  
*** <i>Selecting an IMAP message</i>: one of the states 2, 3, 4
*** <i>Selecting an IMAP message</i>: one of the states 2, 3, 4
270

edits