Self-sent messages disappear from Inbox in unified/combined view (still occurring, related to #149)

Description

Messages sent to myself (same address as sender and recipient) do not reliably show up in the Inbox thread list. Searching by subject does find the message, and opening it shows Folder: Sent in the header — so the message exists and is indexed, but it is not surfaced in the Inbox view.
This looks like the same underlying issue as #149 (“Cannot receive message sent to myself”), which was auto-closed by the stale-bot in 2017 without an actual fix or maintainer response — the label on that issue is stale, not resolved. The behavior described there (message briefly appears in Inbox while sync is running, then disappears) still reproduces today, years later and across major version bumps.
It also looks related to #304 (“Emails Disappear From Inbox”), which notes that not all messages disappear, only most — matching what we see here: some self-sent messages stay visible in Inbox as expected, others silently vanish from the list while still existing server-side and in Mailspring’s local index. The inconsistency suggests a timing/ race condition in the incremental (CONDSTORE-based) sync path rather than a deterministic rule — i.e. whichever folder’s copy (Inbox vs. Sent) gets indexed/deduplicated first during a sync pass appears to determine whether the Inbox thread entry survives.

To Reproduce…

Steps to reproduce the behavior:

  1. Send an email to yourself (From == To) from any account.

  2. Watch the Inbox / unified “All Accounts” thread list — the message may flash in briefly, then disappear.

  3. Confirm the message still exists by searching for its subject: it is found, and its header shows Folder: Sent.

  4. Compare against another IMAP client pointed at the same account (e.g. Thunderbird on Android) — the message is present in INBOX there as expected.

Expected Behavior

A message that exists in the account’s INBOX folder on the server should consistently appear in Mailspring’s Inbox / unified view, regardless of whether it also has a copy in Sent (e.g. because the sender CC’d or sent to themselves).

Screenshots

Setup

  • OS and Version: macOS Sonoma 14.8.5
    • Installation Method: dmg
  • Mailspring Version: Version 1.23.0 (1.23.0)

Additional Context

Related: #149 (closed as stale, not fixed)
Related: #304 (same “some messages disappear, not all” pattern, logs point at the CONDSTORE incremental sync pass)