Skip to content

Commit

Permalink
Changed noop by unselect/select.
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Apr 10, 2013
1 parent 1b983ef commit 33840c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions OpenChange/MAPIStoreMailVolatileMessage.m
Expand Up @@ -943,9 +943,13 @@ - (void) save: (TALLOC_CTX *) memCtx
[mapping registerURL: [self url] withID: mid];

/* synchronise the cache and update the change key with the one provided
by the client. Before doing this, lets issue a noop because of timing
issues with Dovecot. */
[client noop];
by the client. Before doing this, lets issue a unselect/select combo
because of timing issues with Dovecot in obtaining the latest modseq.
Sometimes, Dovecot doesn't return the newly appended UID if we do
a "UID SORT (DATE) UTF-8 (MODSEQ XYZ) (NOT DELETED)" command (where
XYZ is the HIGHESTMODSEQ+1) immediately after IMAP APPEND */
[client unselect];
[client select: folderName];

[(MAPIStoreMailFolder *) container synchroniseCache];
changeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)];
Expand Down

0 comments on commit 33840c7

Please sign in to comment.