Skip to content

Navigation Menu

Sign in
Sign up

public_inbox: Fix email threads without an available root message - #369

Open
mripard wants to merge 4 commits into
psss:main from
mripard:rootless-email-thread
Open

public_inbox: Fix email threads without an available root message #369
mripard wants to merge 4 commits into
psss:main from
mripard:rootless-email-thread

Conversation

@mripard

@mripard mripard commented Jul 15, 2024

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown

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

javierm commented Jul 16, 2024

Copy link
Copy Markdown

Hi, @mripard 😄.

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

mripard commented Jul 17, 2024

Copy link
Copy Markdown
Contributor Author

Yeah, sorry, I meant @martinezjavier

javierm reacted with thumbs up emoji

Copy link
Copy Markdown
Collaborator

Can you please rebase?

Comment thread did/plugins/public_inbox.py Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sandrobonazzola sandrobonazzola sandrobonazzola left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /