From bba6c8f15a06b2550e5ee67bdf0118d5d109e98b Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 27 Jul 2023 13:17:36 +0000 Subject: [PATCH 1/2] fix: emit MsgsChanged event with correct chat id for replaced messages Previously an event with DC_CHAT_ID_TRASH was emitted. --- python/tests/test_1_online.py | 5 +++++ src/receive_imf.rs | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/python/tests/test_1_online.py b/python/tests/test_1_online.py index aeba9b035..0ca45abbf 100644 --- a/python/tests/test_1_online.py +++ b/python/tests/test_1_online.py @@ -376,6 +376,11 @@ def test_webxdc_download_on_demand(acfactory, data, lp): ac2._evtracker.get_matching("DC_EVENT_WEBXDC_STATUS_UPDATE") assert msg2.get_status_updates() + # Get a event notifying that the message disappeared from the chat. + msgs_changed_event = ac2._evtracker.get_matching("DC_EVENT_MSGS_CHANGED") + assert msgs_changed_event.data1 == msg2.chat.id + assert msgs_changed_event.data2 == 0 + def test_mvbox_sentbox_threads(acfactory, lp): lp.sec("ac1: start with mvbox thread") diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 423a73149..99f1b59be 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -143,7 +143,7 @@ pub(crate) async fn receive_imf_inner( // check, if the mail is already in our database. // make sure, this check is done eg. before securejoin-processing. - let replace_partial_download = + let (replace_partial_download, replace_chat_id) = if let Some(old_msg_id) = message::rfc724_mid_exists(context, rfc724_mid).await? { let msg = Message::load_from_db(context, old_msg_id).await?; if msg.download_state() != DownloadState::Done && is_partial_download.is_none() { @@ -152,14 +152,14 @@ pub(crate) async fn receive_imf_inner( context, "Message already partly in DB, replacing by full message." ); - Some(old_msg_id) + (Some(old_msg_id), Some(msg.chat_id)) } else { // the message was probably moved around. info!(context, "Message already in DB, doing nothing."); return Ok(None); } } else { - None + (None, None) }; let prevent_rename = @@ -347,8 +347,8 @@ pub(crate) async fn receive_imf_inner( } } - if replace_partial_download.is_some() { - context.emit_msgs_changed(chat_id, MsgId::new(0)); + if let Some(replace_chat_id) = replace_chat_id { + context.emit_msgs_changed(replace_chat_id, MsgId::new(0)); } else if !chat_id.is_trash() { let fresh = received_msg.state == MessageState::InFresh; for msg_id in &received_msg.msg_ids { From e43f9066d8830b57209c6e205e2f1e3af6959b97 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 3 Aug 2023 16:25:42 +0000 Subject: [PATCH 2/2] chore(release): prepare for 1.119.0 --- CHANGELOG.md | 40 +++++++++++++++++++++++ Cargo.lock | 10 +++--- Cargo.toml | 2 +- deltachat-ffi/Cargo.toml | 2 +- deltachat-jsonrpc/Cargo.toml | 2 +- deltachat-jsonrpc/typescript/package.json | 2 +- deltachat-repl/Cargo.toml | 2 +- deltachat-rpc-server/Cargo.toml | 2 +- package.json | 2 +- release-date.in | 2 +- 10 files changed, 53 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a32589c93..c086ba2e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,45 @@ # Changelog +## [1.119.0] - 2023-08-03 + +### Fixes + +- imap: Avoid IMAP move loops when DeltaChat folder is aliased. +- imap: Do not resync IMAP after initial configuration. + +- webxdc: Accept WebXDC updates in mailing lists. +- webxdc: Base64-encode WebXDC updates to prevent corruption of large unencrypted WebXDC updates. +- webxdc: Delete old webxdc status updates during housekeeping. + +- Return valid MsgId from `receive_imf()` when the message is replaced. +- Emit MsgsChanged event with correct chat id for replaced messages. + +- deltachat-rpc-server: Update tokio-tar to fix backup import. + +### Features / Changes + +- deltachat-rpc-client: Add `MSG_DELETED` constant. +- Make `dc_msg_get_filename()` return the original attachment filename ([#4309](https://github.com/deltachat/deltachat-core-rust/pull/4309)). + +### API-Changes + +- deltachat-rpc-client: Add `Account.{import,export}_backup` methods. +- deltachat-jsonrpc: Make `MessageObject.text` non-optional. + +### Documentation + +- Update default value for `show_emails` in `dc_set_config()` documentation. + +### Refactor + +- Improve IMAP logs. + +### Tests + +- Add basic import/export test for async python. +- Add `test_webxdc_download_on_demand`. +- Add tests for deletion of webxdc status-updates. + ## [1.118.0] - 2023-07-07 ### API-Changes diff --git a/Cargo.lock b/Cargo.lock index 6030233cf..8bc946f5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1123,7 +1123,7 @@ dependencies = [ [[package]] name = "deltachat" -version = "1.118.0" +version = "1.119.0" dependencies = [ "ansi_term", "anyhow", @@ -1199,7 +1199,7 @@ dependencies = [ [[package]] name = "deltachat-jsonrpc" -version = "1.118.0" +version = "1.119.0" dependencies = [ "anyhow", "async-channel", @@ -1223,7 +1223,7 @@ dependencies = [ [[package]] name = "deltachat-repl" -version = "1.118.0" +version = "1.119.0" dependencies = [ "ansi_term", "anyhow", @@ -1238,7 +1238,7 @@ dependencies = [ [[package]] name = "deltachat-rpc-server" -version = "1.118.0" +version = "1.119.0" dependencies = [ "anyhow", "deltachat", @@ -1263,7 +1263,7 @@ dependencies = [ [[package]] name = "deltachat_ffi" -version = "1.118.0" +version = "1.119.0" dependencies = [ "anyhow", "deltachat", diff --git a/Cargo.toml b/Cargo.toml index 18fd4314f..906442e6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat" -version = "1.118.0" +version = "1.119.0" edition = "2021" license = "MPL-2.0" rust-version = "1.65" diff --git a/deltachat-ffi/Cargo.toml b/deltachat-ffi/Cargo.toml index f398a6e2e..59de9ea79 100644 --- a/deltachat-ffi/Cargo.toml +++ b/deltachat-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat_ffi" -version = "1.118.0" +version = "1.119.0" description = "Deltachat FFI" edition = "2018" readme = "README.md" diff --git a/deltachat-jsonrpc/Cargo.toml b/deltachat-jsonrpc/Cargo.toml index 925086448..fff886b9f 100644 --- a/deltachat-jsonrpc/Cargo.toml +++ b/deltachat-jsonrpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat-jsonrpc" -version = "1.118.0" +version = "1.119.0" description = "DeltaChat JSON-RPC API" edition = "2021" default-run = "deltachat-jsonrpc-server" diff --git a/deltachat-jsonrpc/typescript/package.json b/deltachat-jsonrpc/typescript/package.json index 149d9733b..102340f1d 100644 --- a/deltachat-jsonrpc/typescript/package.json +++ b/deltachat-jsonrpc/typescript/package.json @@ -55,5 +55,5 @@ }, "type": "module", "types": "dist/deltachat.d.ts", - "version": "1.118.0" + "version": "1.119.0" } diff --git a/deltachat-repl/Cargo.toml b/deltachat-repl/Cargo.toml index 8762dd0b5..c89b968b7 100644 --- a/deltachat-repl/Cargo.toml +++ b/deltachat-repl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat-repl" -version = "1.118.0" +version = "1.119.0" license = "MPL-2.0" edition = "2021" diff --git a/deltachat-rpc-server/Cargo.toml b/deltachat-rpc-server/Cargo.toml index 9560a0f22..c518f3bf4 100644 --- a/deltachat-rpc-server/Cargo.toml +++ b/deltachat-rpc-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltachat-rpc-server" -version = "1.118.0" +version = "1.119.0" description = "DeltaChat JSON-RPC server" edition = "2021" readme = "README.md" diff --git a/package.json b/package.json index 3051d80cc..8b9d20bb3 100644 --- a/package.json +++ b/package.json @@ -60,5 +60,5 @@ "test:mocha": "mocha -r esm node/test/test.js --growl --reporter=spec --bail --exit" }, "types": "node/dist/index.d.ts", - "version": "1.118.0" + "version": "1.119.0" } diff --git a/release-date.in b/release-date.in index 0e126a1e5..df139e597 100644 --- a/release-date.in +++ b/release-date.in @@ -1 +1 @@ -2023-07-07 \ No newline at end of file +2023-08-03 \ No newline at end of file