fix: Don't download pre-message again if it is known already (#8488)

There was a bug in prefetch_should_download() that it made it return
true for pre-messages even when they were already downloaded. This meant
that pre-messages were downloaded from all relays, rather than just one,
wasting internet data.

The fix is in rfc724_mid_download_tried(), which is used by
prefetch_should_download() to determine whether a message was already
downloaded.

---------

Co-authored-by: l <link2xt@testrun.org>
This commit is contained in:
Hocuri
2026-08-01 12:48:24 +02:00
committed by GitHub
parent 62d3f3877f
commit dc267fe1fb
3 changed files with 59 additions and 11 deletions

View File

@@ -1623,7 +1623,7 @@ pub(crate) async fn prefetch_should_download(
message_id: &str,
mut flags: impl Iterator<Item = Flag<'_>>,
) -> Result<bool> {
if message::rfc724_mid_download_tried(context, message_id).await? {
if message::rfc724_mid_fetch_tried(context, message_id).await? {
if let Some(from) = mimeparser::get_from(headers)
&& context.is_self_addr(&from.addr).await?
{