]> git.g-eek.se Git - interimap.git/commitdiff
bugfix: when resuming a sync, only consider UIDs greater than a known UIDNEXT.
authorGuilhem Moulin <guilhem@fripost.org>
Tue, 22 Nov 2016 18:41:46 +0000 (19:41 +0100)
committerGuilhem Moulin <guilhem@fripost.org>
Tue, 22 Nov 2016 18:41:46 +0000 (19:41 +0100)
interimap

index eccd3abae01a892efcf128578be7df093f4a3045..7a36c4e6ca1d7f29e7cbb9e7f3eb939bf2f240fb 100755 (executable)
--- a/interimap
+++ b/interimap
@@ -1088,6 +1088,18 @@ while (defined (my $row = $STH_LIST_INTERRUPTED->fetchrow_arrayref())) {
     # the _MODIFIED internal cache has been initialized with all our
     # UIDs.  (Since there is no reliable HIGHESTMODSEQ, any flag
     # difference is treated as a conflict.)
+    $STH_GET_CACHE_BY_IDX->execute($IDX);
+    if (defined (my $cache = $STH_GET_CACHE_BY_IDX->fetchrow_hashref())) {
+        $lIMAP->set_cache($cache->{mailbox},
+            UIDVALIDITY => $cache->{lUIDVALIDITY},
+            UIDNEXT     => $cache->{lUIDNEXT}
+        );
+        $rIMAP->set_cache($cache->{mailbox},
+            UIDVALIDITY => $cache->{rUIDVALIDITY},
+            UIDNEXT     => $cache->{rUIDNEXT}
+        );
+        die if defined $STH_GET_CACHE_BY_IDX->fetch(); # sanity check
+    }
     sync_messages($IDX, $MAILBOX, [keys %lList], [keys %rList]);
 }