Threads with one mail moved to trash are not found when using the search bar

Description

I had issues with some emails not showing up in my search results. After trying out a few things, here’s what I believe is happening: if I delete one email from a thread (e.g. a draft email that I eventually doesn’t send), then the whole thread is flagged as “in trash”. It still shows up in my inbox, but is not found when searching, unless I specify “in:Trash”. Not that the email I’m searching for has never been in the trash, it’s only another email from the same thread that was sent to trash, and seems to affect the whole thread.
Note: This is using Mailspring 1.7.8-13635bcf on Ubuntu 20.04

To Reproduce…

Steps to reproduce the behavior:

  1. Go to an email thread in your inbox
  2. Try searching this email using the search bar: should work
  3. Delete one of the emails in the thread, either from e.g. the gmail site, or start a reply, wait for it to be saved as draft, then delete it
  4. Try searching the same thread using the same email as before, it shouldn’t work anymore
  5. Try the same search with “in:Trash”: you should find the thread back (although the thread itself shows up in the Inbox).

Expected Behavior

I would expect the thread to still show up in the search results even if one of the emails along the thread was put into trash. Actually, I would expect it to be returned unless all emails in the thread are marked “trash” and/or “spam”.

Setup

  • OS and Version: Ubuntu 20.04
  • Mailspring Version: Mailspring 1.7.8-13635bcf

Additional Context

Note: could be maybe linked to Search is not working (some results not showing up in the search results, work-around was to re-build the cache), and #1605 (changed default behavior so that mails in trash don’t show up in search results)


(Originally posted by simroux on GitHub.)

Just came here to report the same problem: If at least one email in the thread is in Trash the search function will not find it unless explicitly searching in Trash as well.

OS: Linux Mint 20.1 Ulyssa
Mailspring Version: 1.9.0 - 87660767

Hi,

I have the same issue. This along with the issues of trash not being emptied can become quite inconvenient (especially when you have large mailboxes) as the only way to remediate this seems to be to rebuild cache.