Compare commits

..

1 Commits

Author SHA1 Message Date
link2xt
19d3485758 ci: run legacy Python tests only on CPython and Linux
macOS runners are slow
and for PyPy users should switch to JSON-RPC bindings.
We are only running legacy Python tests
to test the Rust code behaivor and CFFI,
but not the Python bindings,
so testing one implementation is enough.
2026-05-20 04:25:02 +02:00
3 changed files with 13 additions and 48 deletions

View File

@@ -62,7 +62,7 @@ jobs:
with:
show-progress: false
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@6c8f9facfa5047ec02d8485b6bf52b587b7777d1
- uses: EmbarkStudios/cargo-deny-action@91bf2b620e09e18d6eb78b92e7861937469acedb
with:
arguments: --workspace --all-features --locked
command: check
@@ -281,17 +281,9 @@ jobs:
fail-fast: false
matrix:
include:
# Currently used Rust version.
# Currently used Python version.
- os: ubuntu-latest
python: 3.14
- os: macos-latest
python: 3.14
# PyPy tests
- os: ubuntu-latest
python: pypy3.10
- os: macos-latest
python: pypy3.10
python: "3.14"
# Minimum Supported Python Version = 3.10
# This is the minimum version for which manylinux Python wheels are

View File

@@ -779,6 +779,10 @@ impl Imap {
info!(context, "{} mails read from \"{}\".", read_cnt, folder);
if !received_msgs.is_empty() {
context.emit_event(EventType::IncomingMsgBunch);
}
chat::mark_old_messages_as_noticed(context, received_msgs).await?;
if fetch_res.is_ok() {
@@ -1265,6 +1269,7 @@ impl Session {
///
/// If the message is incorrect or there is a failure to write a message to the database,
/// it is skipped and the error is logged.
#[expect(clippy::arithmetic_side_effects)]
pub(crate) async fn fetch_many_msgs(
&mut self,
context: &Context,
@@ -1272,36 +1277,6 @@ impl Session {
request_uids: Vec<u32>,
uid_message_ids: &BTreeMap<u32, String>,
received_msgs_channel: Sender<(u32, Option<ReceivedMsg>)>,
) -> Result<()> {
let mut received_at_least_one = false;
let res = self
._fetch_many_msgs(
context,
folder,
request_uids,
uid_message_ids,
async |uid, msg| {
if msg.is_some() {
received_at_least_one = true;
}
received_msgs_channel.send((uid, msg)).await?;
Ok(())
},
)
.await;
if received_at_least_one {
context.emit_event(EventType::IncomingMsgBunch);
}
return res;
}
#[expect(clippy::arithmetic_side_effects)]
async fn _fetch_many_msgs(
&mut self,
context: &Context,
folder: &str,
request_uids: Vec<u32>,
uid_message_ids: &BTreeMap<u32, String>,
mut on_msg_received: impl AsyncFnMut(u32, Option<ReceivedMsg>) -> Result<()>,
) -> Result<()> {
if request_uids.is_empty() {
return Ok(());
@@ -1373,7 +1348,7 @@ impl Session {
if is_deleted {
info!(context, "Not processing deleted msg {}.", request_uid);
on_msg_received(request_uid, None).await?;
received_msgs_channel.send((request_uid, None)).await?;
continue;
}
@@ -1384,7 +1359,7 @@ impl Session {
context,
"Not processing message {} without a BODY.", request_uid
);
on_msg_received(request_uid, None).await?;
received_msgs_channel.send((request_uid, None)).await?;
continue;
};
@@ -1417,7 +1392,9 @@ impl Session {
}
Ok(msg) => msg,
};
on_msg_received(request_uid, received_msg).await?;
received_msgs_channel
.send((request_uid, received_msg))
.await?;
}
// If we don't process the whole response, IMAP client is left in a broken state where

View File

@@ -462,10 +462,6 @@ async fn get_to_and_past_contact_ids(
/// downloaded again, sets `chat_id=DC_CHAT_ID_TRASH` and returns `Ok(Some(…))`.
/// If the message is so wrong that we didn't even create a database entry,
/// returns `Ok(None)`.
///
/// The caller must emit [`EventType::IncomingMsgBunch`]
/// if this function returned `Ok(Some)`, because that usually (but not always)
/// means that this function emitted [`EventType::IncomingMsg`].
pub(crate) async fn receive_imf_inner(
context: &Context,
rfc724_mid: &str,