changeset 4981:173c5ea4a7c4 HEAD

If we didn't sync everything in the view, we could have synced some transactions multiple times causing different kinds of problems.
author Timo Sirainen <tss@iki.fi>
date Sun, 31 Dec 2006 18:09:00 +0200
parents 8e88ecc64563
children 118db9212f77
files src/lib-index/mail-index-view-sync.c
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-view-sync.c	Fri Dec 29 01:21:06 2006 +0200
+++ b/src/lib-index/mail-index-view-sync.c	Sun Dec 31 18:09:00 2006 +0200
@@ -369,6 +369,15 @@
 		if (view_sync_pos_find(&view->syncs_done, seq, offset))
 			continue;
 
+		if (ctx->skipped_some) {
+			/* We've been skipping some transactions, which means
+			   we'll go through these same transactions again
+			   later. Since we're syncing this one, we don't want
+			   to do it again. */
+			mail_index_view_add_synced_transaction(view, seq,
+							       offset);
+		}
+
 		/* Apply transaction to view's mapping if needed (meaning we
 		   didn't just re-map the view to head mapping). */
 		if (ctx->sync_map_update) {
@@ -392,13 +401,6 @@
 			continue;
 		break;
 	}
-
-	if (ctx->skipped_some) {
-		/* We've been skipping some transactions, which means we'll
-		   go through these same transaction again later. Since we're
-		   syncing this one, we don't want to do it again. */
-		mail_index_view_add_synced_transaction(view, seq, offset);
-	}
 	return 1;
 }