Skip to content

fix: group get_email_thread by Message-ID instead of subject - #110

Merged
patrickfreyer merged 1 commit into
patrickfreyer:mainfrom
herbeckrobin:fix/thread-message-id
Oct 15, 2026
Merged

patrickfreyer merged 1 commit into
patrickfreyer:mainfrom
herbeckrobin:fix/thread-message-id

Conversation

@herbeckrobin

Copy link
Copy Markdown
Contributor

Split out of #98. get_email_thread grouped by subject, so unrelated mails with the same subject ended up in one thread. It now follows Message-ID, In-Reply-To and References. This changes which mails a thread returns, noted as a behavior change in the changelog. Does that fit how you want threads to work, or should subject stay as a fallback?

@patrickfreyer

Copy link
Copy Markdown
Owner

This review was written by Claude (AI assistant) on Patrick's behalf.

Thanks @herbeckrobin, the Message-ID linking is solid (filtering in Mail with whose, int(float()) for exponent output, looping until nothing new links in), 132 tests pass.

On your question: the "same subject but no link" section already acts as the subject fallback, so we'd keep it as is.

Two nits, plus the CHANGELOG rebase:

  • max_messages now caps candidates before linking (search.py:713/719), so the newest-message seed (:812) is only the newest of the first N that Mail returns. Worth a line in the docstring at :877.
  • Swap the em dash in the docstring at :803 for a comma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants