Account missing from unified “All Accounts” Inbox/Trash after fixing sync_error via Update Connection Settings (reappears after selecting it in the account picker once)

Description

An IMAP account that had been in a sync_error state is not listed under the per-account rows of the unified “All Accounts” Inbox (and Trash) after I fixed the connection settings and the sync recovered. The account is present in the account picker, in Preferences > Accounts, and its own view works and shows mail. Only the unified “All Accounts” view omits it.

Selecting the account once in the picker and then switching back to “All Accounts” makes it appear in the unified view.

Only observed with this one account so far (generic IMAP, Dovecot-style folder layout: INBOX, INBOX.spam, Mailspring, Mailspring.Snoozed). I haven’t tested whether it also happens with other account types.

To Reproduce

Steps to reproduce the behavior (this is what I did; I have NOT yet checked whether fewer steps suffice):

  1. Have an IMAP account that syncs fine, shown in the unified “All Accounts” Inbox.
  2. The server starts presenting a TLS certificate for a different hostname (*.zxcs.nl instead of mail.<domain>). The account goes to sync_error (mailsync: ErrorCertificate at syncFoldersAndLabels - fetchAllFolders, repeated on every restart).
  3. Preferences > Accounts > select the account > “Update Connection Settings…” and change the IMAP/SMTP host to one covered by the certificate.
  4. Sync now works (the log shows normal sync and IDLE, no errors), and the account’s own view shows mail.
  5. Look at the sidebar under “All Accounts” > Inbox (and Trash): the account has no row. The other 5 accounts do.
  6. I tried “Rebuild Cache…” and a full quit and relaunch. No change.

Expected Behavior

The account appears in the unified “All Accounts” Inbox/Trash rows as before, without needing to be selected manually.

Setup

  • OS and Version: macOS 14.8.5, Apple Silicon
    • Installation Method: dmg
  • Mailspring Version: Version 1.26.2 (1.26.2)]

Additional Context

  • The config’s syncError for the account still held the old ErrorCertificate after recovery, while syncState was ok. I don’t know whether this stale error is related.
  • My first guess was that the account’s folders had lost their roles. This is ruled out: the account’s own view shows Inbox, Sent, spam, Archive, Trash and Drafts correctly.
  • Unverified: whether the account stays in the unified view after another relaunch. [UPDATE before posting]
  • Unverified: whether the same thing happens for any account that recovers from sync_error, or only after “Update Connection Settings…”.
  • Mail provider: shared hosting with a Dovecot-style server (IMAP over SSL/TLS on 993, SMTP on 465, “allow insecure SSL” was enabled).
  • I can provide the mailsync log for the account on request. I won’t attach config.json because it contains credentials and a token.