mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 08:13:50 +00:00
JMAP thread ids are only unique within their account - Stalwart hands out per-account counters such as "b" - so the cross-account views merged unrelated conversations that happened to share an id, and every client-side thread map (expansion, cache, loading flag, counts, virtualizer key) mixed them up the same way. Give ThreadGroup an account-scoped `threadKey` derived from the email's source stamps and key grouping and all thread state by it. `threadId` stays the raw id for Thread/get, which #281 already routes to the owning account. fetchThreadEmailCounts now asks each source account for its own threads instead of one client for every id. Single-account views carry no stamps, so their key is the bare id and nothing changes there.