canmove, Confirmed users
2,237
edits
m (→How To Do It) |
m (→Related Bugs: update bug status) |
||
| (6 intermediate revisions by one other user not shown) | |||
| Line 10: | Line 10: | ||
'''''Only download what I ask for and only download it once.''''' | '''''Only download what I ask for and only download it once.''''' | ||
There are a number of bugs/features at the moment that are stopping this from happening, namely {{bug|405437}}, {{bug|345832}} and {{bug| | There are a number of bugs/features at the moment that are stopping this from happening, namely {{bug|405437}}, {{bug|345832}}, {{bug|439731}} and {{bug|470624}} (see [[#Related Bugs |Related Bugs]]). | ||
=== Desired Behaviour === | === Desired Behaviour === | ||
| Line 58: | Line 58: | ||
Implementing these features, particularly 3a) and 3b), will have the side benefit of fixing (or partly fixing) a number of existing bugs related to messages or message parts being repeatedly downloaded: | Implementing these features, particularly 3a) and 3b), will have the side benefit of fixing (or partly fixing) a number of existing bugs related to messages or message parts being repeatedly downloaded: | ||
* {{bug|345832}} - IMAP attachments preloading (not on demand) | * <strike>{{bug|345832}}</strike> - INVALID - IMAP attachments preloading (not on demand) | ||
* {{bug|439731}} - | * <strike>{{bug|439731}}</strike> - FIXED - Reloading of read messages when using IMAP account (enable disk cache) | ||
* {{bug|405437}} - IMAP mail are not cached for offline use if message size is bigger than mail.imap.mime_parts_on_demand_threshold | * <strike>{{bug|405437}}</strike> - WFM IMAP mail are not cached for offline use if message size is bigger than mail.imap.mime_parts_on_demand_threshold | ||
* {{bug|470624}} - described in this wiki - RFE: On-demand Auto-Sync | |||
=== How To Do It === | === How To Do It === | ||
| Line 66: | Line 67: | ||
With the exception of on-demand sync 1) and 2) can be implemented using strategies. These features and more will be supported in an extension, [[#Incommunicado Extension | Incommunicado]]. | With the exception of on-demand sync 1) and 2) can be implemented using strategies. These features and more will be supported in an extension, [[#Incommunicado Extension | Incommunicado]]. | ||
On-demand auto-sync (an oxymoron I know) however requires some development. [[User:Emre|Emre]] has proposed the following implementation: | On-demand auto-sync ({{bug|470624}}) (an oxymoron I know) however requires some development. [[User:Emre|Emre]] has proposed the following implementation: | ||
* Add a new operation mode (lets say on-demand) to nsAutoSyncManager. | * Add a new operation mode (lets say on-demand) to nsAutoSyncManager. | ||
* Add new method to nsAutoSyncManager to explicitly tell to re-prioritize the queue. | * Add new method to nsAutoSyncManager to explicitly tell to re-prioritize the queue. | ||
| Line 73: | Line 74: | ||
Addressing 3) is non-trivial and will be tackled at a later stage, in the meantime it may be possible to avoid current problems by increasing the cache size and configuring it to save to disk rather than memory ([https://bugzilla.mozilla.org/show_bug.cgi?id=439731#c12 bug 439731 #12]). | Addressing 3) is non-trivial and will be tackled at a later stage, in the meantime it may be possible to avoid current problems by increasing the cache size and configuring it to save to disk rather than memory ([https://bugzilla.mozilla.org/show_bug.cgi?id=439731#c12 bug 439731 #12]). | ||
==== On-Demand Sync ==== | |||
===== State Diagram ===== | |||
The finite state diagram below describes the sync states of a folder during on-demand sync. This is based on how auto-sync currently works, the notable differences are: | |||
# The SyncCompleted and SyncFailed '''end''' states. In auto-sync a folder is simply removed from the queue either because all of its messages have been downloaded or the number of retries was exceeded. | |||
# Substates are clearly defined. In auto-sync the substates ReadyToDiscover and ReadyToUpdate are inferred by a folder being in the Discover or Update queue respectively. In on-demand sync a folder's state will need to be explicitly defined either by a substate property or by a function that checks other attributes such as the state of internal queues. | |||
# Folders can only be in one state at a time. This is implied by the previous point. In auto-sync a folder can be in more than one queue at a time (I think), which as an implicit state breaks the FSM model. | |||
<small> | |||
<small> | |||
<pre> | |||
.---------------. | |||
. --------------- . | |||
|| SyncCompleted || | |||
' --------------- ' | |||
'---------------' | |||
^ | |||
| | |||
/ | |||
. discoverMessages() | |||
| .-------. | |||
syncCompleted() / \ | |||
. ' . | |||
\ pendingHeaders() > 0 | | pendingMessages() > 0 downloadMessages() | |||
------. \ .----------------. \ v .----------------. .----------------. | |||
/ ------------- / `-> --------------- / `-> --------------- / `-> ------------------ | |||
------>|IdleCompleted| |ReadyToDiscover| |ReadyToDownload| |DownloadInProgress| | |||
------------- <- / --------------- <- / --------------- <- / ------------------ | |||
^ \ `-----------------' `-----------------' `-----------------' ^ \ | |||
| \ pendingHeaders() = 0 pendingMessages() = 0 downloadOK() | \ | |||
/ \ / \ | |||
/ . . . | |||
/ | | downloadFail() | |||
/ headersOutOfDate() | | | |||
/ | | | | |||
. | retriesRemaing() > 0 | | |||
| . . . | |||
updateOK() / \ / | |||
| | \ | | |||
| v \ v | |||
| ------------- ------------ | |||
| |ReadyToUpdate| |DownloadFail| | |||
| ------------- ------------ | |||
| \ \ | |||
| \ \ | |||
| . . | |||
. | retriesRemaing() = 0 | |||
\ updateHeaders() | | |||
\ | . | |||
\ . / | |||
\ / | | |||
\ | updateFail() retriesRemaining() = 0 v | |||
\ v .-------------------------------------. .----------------------------------------. .------------. | |||
---------------- / `-> ---------- / `->. ------------ . | |||
|UpdateInProgress| |UpdateFail| || SyncFailed || | |||
---------------- <- / ---------- ' ------------ ' | |||
`--------------------------------------' '------------' | |||
retriesRemaing() > 0 | |||
</pre> | |||
</small> | |||
</small> | |||
=== Milestones === | === Milestones === | ||
'''Thunderbird 3.0b2:''' | '''Thunderbird 3.0b2:''' | ||
* on-demand auto-sync | * on-demand auto-sync ({{bug|470624}}) | ||
* auto-sync strategy to exclude messages greater than MAX_SIZE (Incommunicado) | * auto-sync strategy to exclude messages greater than MAX_SIZE (Incommunicado) | ||
* on/off/on-demand auto-sync UI (Incommunicado) | * on/off/on-demand auto-sync UI (Incommunicado) | ||
'''Thunderbird 3.0pre1:''' | '''Thunderbird 3.0pre1:''' | ||
* save cache to disk and increase size [https://bugzilla.mozilla.org/show_bug.cgi?id=439731#c12 bug 439731 #12] | * save cache to disk and increase size ([https://bugzilla.mozilla.org/show_bug.cgi?id=439731#c12 bug 439731 #12]) (Temporary fix) | ||
* priority auto-sync folders (Incommunicado) | * priority auto-sync folders (Incommunicado) | ||
* advanced on-demand auto-sync runtime dialog (Incommunicado) | * advanced on-demand auto-sync runtime dialog (Incommunicado) | ||