[Tickets #11823] Activesync push for empty folders loops

bugs at horde.org bugs at horde.org
Thu Dec 6 11:44:41 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11823
------------------------------------------------------------------------------
  Ticket             | 11823
  Created By         | horde at albasoft.com
  Summary            | Activesync push for empty folders loops
  Queue              | Synchronization
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


horde at albasoft.com (2012-12-06 11:44) wrote:

I've found in my device log that PING command always returns status 2  
when the folder is empty, forcing the device to launch a SYNC command  
that will return no messages. And over again.

I've searched into the code and this is my report:
- First SYNC command (synckey 0) for an empty IMAP folder creates a  
new folder object with yet no status information (uidnext undef), and  
saves state to database at the end of folder sync (s:1:"s";a:0:{}).
- Second SYNC command (synckey {}1) for that folder loads state from  
database (no uidnext) and then runs message diff engine, getting the  
IMAP folder uidnext for its first time. If there were email messages,  
they would be sent and folder status saved again to database at end of  
folder sync, with proper uidnext. But there are no messages, and state  
is not saved to database, so uidnext remains undef.
- Then device sends a PING for that folder. Folder state is loaded  
from database, with uidnext still undef. Then diff engine is launched,  
but uidnext is still undef and when checking against real IMAP folder  
uidnext (0 <> xx) it will always report changes available, returning  
PING status 2.
- Third SYNC command from device, forced by PING status 2, will be  
exactly as previous second SYNC: no new messages but folder status  
will not be update with proper uidnext.
- Devices sends a new PING, and these two steps repeat many times  
until device desists.

I think that uidnext value should be updated to database folder state  
at some point in a SYNC command, so diff engine on a PING command  
could find that real and saved uidnext values are equal and report no  
changes to device.





More information about the bugs mailing list