Skip to content

Conversation

mripard
Copy link
Contributor

@mripard mripard commented Jul 15, 2024

Hi,

@stefano-garzarella and @javierm have been reporting on the public-inbox plugin #329 that they were having crashes.

It turns out that lore doesn't always manage to archive all the messages and we might find emails with a valid in-reply-to header, but can't retrieve the message from the ML archive.

This was partly due to an improper type annotation, so this PR fixes both the type annotations and the actual bug they were both facing.

@stefano-garzarella
Copy link

Thanks! Tested with my setup and this PR fixes the issue!

@javierm
Copy link

javierm commented Jul 16, 2024

Hi, @mripard 😄.

I'm afraid I haven't reported anything; don't even know this project 🤔. Wrong username, maybe?

@mripard
Copy link
Contributor Author

mripard commented Jul 17, 2024

Yeah, sorry, I meant @martinezjavier

@sandrobonazzola
Copy link
Collaborator

Can you please rebase?

@mripard mripard force-pushed the rootless-email-thread branch from 240b72c to 1a02f14 Compare May 21, 2025 12:46
@sandrobonazzola sandrobonazzola force-pushed the rootless-email-thread branch from 1a02f14 to ab4318b Compare May 22, 2025 07:03
@mripard mripard force-pushed the rootless-email-thread branch 2 times, most recently from acb1782 to d67ea38 Compare July 10, 2025 11:45
mripard added 4 commits July 28, 2025 15:58
Some type hints were set to return a given type, while the function was
actually returning that type, or a None object.

Fix the type hints when relevant.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Some messages will not be perfect, and will have inconsistent or missing
headers.

We were mostly handling them fine, but didn't log anything when that was
happening, making debugging issues fairly difficult. Let's improve the
logging a bit.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Commit af2b8ac ("Fix pylint R1710") made __fetch_thread_root()
return the original message argument if no thread root could be found.

However, and even though it wasn't really handled yet, the intent was
always to return None in such a case.

Restore the previous behaviour, but in an explicit way this time, and
we'll handle it in the callers in the next commit.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
A message can have an In-Reply-To header but the message it points to
might not be available for some reason.

In such a case, the Message.parent_id() method will return a proper
value, but __fetch_thread_root() on that message might not and would
return None.

Let's handle that case by returning the latest message we found as the
root message.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
@sandrobonazzola sandrobonazzola force-pushed the rootless-email-thread branch from d67ea38 to a30cda7 Compare July 28, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants