From edcc199461f6c9205bab73e3bee366d7d2497c34 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 17 Mar 2023 09:20:34 +0000 Subject: [PATCH 1/2] Fix clippy::redundant-async-block warnings --- src/contact.rs | 2 +- src/scheduler.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/contact.rs b/src/contact.rs index 4b8c4c3ab..1d00a80f0 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1552,7 +1552,7 @@ impl RecentlySeenLoop { pub(crate) fn new(context: Context) -> Self { let (interrupt_send, interrupt_recv) = channel::bounded(1); - let handle = task::spawn(async move { Self::run(context, interrupt_recv).await }); + let handle = task::spawn(Self::run(context, interrupt_recv)); Self { handle, interrupt_send, diff --git a/src/scheduler.rs b/src/scheduler.rs index 13582d2ea..daa542940 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -501,7 +501,7 @@ impl Scheduler { let (inbox_start_send, inbox_start_recv) = channel::bounded(1); let handle = { let ctx = ctx.clone(); - task::spawn(async move { inbox_loop(ctx, inbox_start_send, inbox_handlers).await }) + task::spawn(inbox_loop(ctx, inbox_start_send, inbox_handlers)) }; let inbox = SchedBox { meaning: FolderMeaning::Inbox, @@ -521,9 +521,7 @@ impl Scheduler { let (conn_state, handlers) = ImapConnectionState::new(&ctx).await?; let (start_send, start_recv) = channel::bounded(1); let ctx = ctx.clone(); - let handle = task::spawn(async move { - simple_imap_loop(ctx, start_send, handlers, meaning).await - }); + let handle = task::spawn(simple_imap_loop(ctx, start_send, handlers, meaning)); oboxes.push(SchedBox { meaning, conn_state, @@ -535,7 +533,7 @@ impl Scheduler { let smtp_handle = { let ctx = ctx.clone(); - task::spawn(async move { smtp_loop(ctx, smtp_start_send, smtp_handlers).await }) + task::spawn(smtp_loop(ctx, smtp_start_send, smtp_handlers)) }; start_recvs.push(smtp_start_recv); From 6c5654f584febfaba701312e4aed2c4d45e88f21 Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Fri, 17 Mar 2023 15:35:08 +0100 Subject: [PATCH 2/2] fix: do not delete columns This requires currently too much memory, crashing on larger instances --- CHANGELOG.md | 1 - src/sql/migrations.rs | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 544a6ccf7..8bdd67bc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ ## Unreleased ### Changes -- Drop unused SQL columns #4141 - "full message view" not needed because of footers that go to contact status #4151 - Pick up system's light/dark mode in generated message HTML #4150 - Support non-persistent configuration with DELTACHAT_* env diff --git a/src/sql/migrations.rs b/src/sql/migrations.rs index d23261862..046db4fb2 100644 --- a/src/sql/migrations.rs +++ b/src/sql/migrations.rs @@ -691,15 +691,18 @@ CREATE INDEX smtp_messageid ON imap(rfc724_mid); sql.set_db_version(98).await?; } if dbversion < 99 { - sql.execute_migration( - "ALTER TABLE msgs DROP COLUMN server_folder; - ALTER TABLE msgs DROP COLUMN server_uid; - ALTER TABLE msgs DROP COLUMN move_state; - ALTER TABLE chats DROP COLUMN draft_timestamp; - ALTER TABLE chats DROP COLUMN draft_txt", - 99, - ) - .await?; + // sql.execute_migration( + // "ALTER TABLE msgs DROP COLUMN server_folder; + // ALTER TABLE msgs DROP COLUMN server_uid; + // ALTER TABLE msgs DROP COLUMN move_state; + // ALTER TABLE chats DROP COLUMN draft_timestamp; + // ALTER TABLE chats DROP COLUMN draft_txt", + // 99, + // ) + // .await?; + + // Reverted above, as it requires to load the whole DB in memory. + sql.set_db_version(99).await?; } let new_version = sql