6.0.0-alpha14
7/2/25

[#12941] AS: Transition to MODSEQ enabled IMAP server
Summary AS: Transition to MODSEQ enabled IMAP server
Queue Synchronization
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester thomas.jarosch (at) intra2net (dot) com
Created 01/29/2014 (4172 days ago)
Due
Updated 01/31/2014 (4170 days ago)
Assigned 01/29/2014 (4172 days ago)
Resolved 01/31/2014 (4170 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
01/31/2014 04:06:23 PM Michael Rubinsky State ⇒ Resolved
 
01/31/2014 04:06:09 PM Git Commit Comment #5 Reply to this comment
Changes have been made in Git (master):

commit 5d55e8b1870518b54e8aa537c2d33dfcee877678
Author: Thomas Jarosch <thomas.jarosch@intra2net.com>
Date:   Wed Jan 29 12:13:03 2014 +0100

     Fix transition to MODSEQ-enabled IMAP server. Bug #12941

  .../lib/Horde/ActiveSync/Imap/Adapter.php          |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/5d55e8b1870518b54e8aa537c2d33dfcee877678
01/29/2014 03:49:42 PM Michael Rubinsky Comment #4
Assigned to Michael Rubinsky
State ⇒ Assigned
Reply to this comment
Looks good.

I considered something like this but didn't think it unreasonable to 
require state reset when doing something as drastic as changing out 
the imap server. Since it's such a simple patch though, no reason to 
not include it.

Thanks.
01/29/2014 11:18:08 AM Thomas Jarosch Comment #3
New Attachment: activesync_modseq_transition_fix.txt Download
Reply to this comment
Partial ActiveSync log file after applying the patch.

01/29/2014 11:17:17 AM Thomas Jarosch Comment #2
New Attachment: 0001-Fix-transition-to-MODSEQ-enabled-IMAP-server.-Bug-12.patch Download
Patch ⇒ Yes
Reply to this comment
Tested proof of concept patch.

01/29/2014 10:31:34 AM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ AS: Transition to MODSEQ enabled IMAP server
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Hi,

I finally transitioned to a MODSEQ-enabled IMAP server. The cached 
"collection" data is still from the old non-MODSEQ based cyrus server.

Since the transition, the phones won't sync new IMAP messages until I 
reset the collection.
Here's the relevant log:

----------------------------
2014-01-29T10:37:27+01:00 SAMSUNG1358490047903217 INFO: [15177] 
Initializing message diff engine for 0270adeb (INBOX)
2014-01-29T10:37:27+01:00 SAMSUNG1358490047903217 INFO: [15177] Using 
SYNCSTAMP 1390988247 for 0270adeb.
2014-01-29T10:37:27+01:00 SAMSUNG1358490047903217 INFO: [15177] 
Horde_Core_ActiveSync_Driver::getServerChanges(INBOX, 1390806313, 
1390988247, 1389778647, 0)
2014-01-29T10:37:27+01:00 SAMSUNG1358490047903217 INFO: [15177] 
MODSEQ: 0                       <-- this is $folder->modseq()
----------------------------

Let's take a look at Imap/Adapter.php::getMessageChanges() with
     $folder->modseq(): 0
    $modseq: 102

The current code does not handle this case as the non-CONDSTORE sync code path
tests "if ($modseq == 0)".

We also can't change that last condition to "if ($modseq == 0 || 
$folder->modseq() == 0)" since
the array data layout of $messages or $flags in Folder/Imap.php is 
different for the non-MODSEQ / MODSEQ mode -> we might end up with 
trashed data structures.

Right now I think it's best we should detect the transition and throw 
a Horde_ActiveSync_Exception_StaleState exception.

Thoughts?

Saved Queries