]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: "first saved UID of the day" wasn't updated right always.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 10 May 2016 14:42:33 +0000 (10:42 -0400)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 10 May 2016 20:20:41 +0000 (16:20 -0400)
It was using the UID of the first append. But it may not have been the
lowest UID. Do this after the appends are first sorted by their UID.

src/lib-index/mail-index-transaction-finish.c

index d399c33b9ab58f609dab8d9fcb362d9baba52e9a..dfd4da3c1247f9d2e2190474759d8f191738af17 100644 (file)
@@ -326,8 +326,8 @@ mail_index_transaction_convert_to_uids(struct mail_index_transaction *t)
 void mail_index_transaction_finish(struct mail_index_transaction *t)
 {
        if (array_is_created(&t->appends)) {
-               mail_index_update_day_headers(t);
                mail_index_transaction_sort_appends(t);
+               mail_index_update_day_headers(t);
        }
        mail_index_transaction_finish_flag_updates(t);