From eff81f34bb51ecc6e0aa5d831567db2cea0527a9 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 15 Jul 2026 19:31:17 -0500 Subject: fix: give inbox threads identity distinct from their grouping key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit InboxThreadSummary.id returned threadGroupingKey, which is listRID plus the subject with Re:/Fwd: stripped. Two unrelated threads on one list sharing a subject therefore shared an id — common on sourcehut, where "[PATCH] test" is an ordinary subject — which collides under Identifiable in every list that renders these summaries. Key id on the root Message-ID, which is unique per thread, and leave threadGroupingKey subject-based so replies still collapse into one conversation. Read state moves to threadGroupingKey at each call site. It was already keyed on that string via id, so persisted keys are unchanged and marking a conversation read still covers the whole subject group, matching how HomeViewModel already builds the key for isUnread. --- Hutch/Models/Inbox.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Hutch/Models') diff --git a/Hutch/Models/Inbox.swift b/Hutch/Models/Inbox.swift index 071bcbc..be2e105 100644 --- a/Hutch/Models/Inbox.swift +++ b/Hutch/Models/Inbox.swift @@ -17,8 +17,11 @@ struct InboxThreadSummary: Identifiable, Hashable, Sendable { let containsPatch: Bool let isUnread: Bool + /// Identity is per-thread, keyed on the root Message-ID. It deliberately differs + /// from ``threadGroupingKey``, which is subject-based so replies collapse into + /// one conversation — two unrelated threads can share a subject on the same list. var id: String { - threadGroupingKey + "\(listRID)#\(rootMessageID)" } var listDisplayName: String { -- cgit v1.2.3