Skip to content

Commit

Permalink
imapc: Fix assert-crash if syncing adds delayed expunges, but fails a…
Browse files Browse the repository at this point in the history
…fterwards

Fixes:
Panic: file imapc-sync.c: line 328 (imapc_initial_sync_check): assertion failed: (mail_index_is_expunged(view, lseq) || seq_range_exists(&ctx->mbox->delayed_expunged_uids, luid))
  • Loading branch information
sirainen committed Jun 18, 2018
1 parent 4273c57 commit 15ff00a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib-storage/index/imapc/imapc-sync.c
Expand Up @@ -496,13 +496,13 @@ static int imapc_sync_finish(struct imapc_sync_context **_ctx)
int ret = ctx->failed ? -1 : 0;

*_ctx = NULL;
if (ret == 0) {
if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) {
mailbox_set_index_error(&ctx->mbox->box);
ret = -1;
}
} else {
mail_index_sync_rollback(&ctx->index_sync_ctx);
/* Commit the transaction even if we failed. This is important, because
during the sync delayed_sync_trans points to the sync transaction.
Even if the syncing doesn't fully succeed, we don't want to lose
changes in delayed_sync_trans. */
if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) {
mailbox_set_index_error(&ctx->mbox->box);
ret = -1;
}
if (ctx->mbox->sync_gmail_pop3_search_tag != NULL) {
mailbox_set_critical(&ctx->mbox->box,
Expand Down

0 comments on commit 15ff00a

Please sign in to comment.