summaryrefslogtreecommitdiff
path: root/Hutch/App/RootView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-15 19:31:17 -0500
committerChristian Cleberg <[email protected]>2026-07-15 19:31:17 -0500
commiteff81f34bb51ecc6e0aa5d831567db2cea0527a9 (patch)
tree5a15795380b4f98c4b003f1243409f8e7b59caa3 /Hutch/App/RootView.swift
parentc5247f7021090358e8db70daa9ed09521e9f206a (diff)
downloadhutch-eff81f34bb51ecc6e0aa5d831567db2cea0527a9.tar.gz
hutch-eff81f34bb51ecc6e0aa5d831567db2cea0527a9.tar.bz2
hutch-eff81f34bb51ecc6e0aa5d831567db2cea0527a9.zip
fix: give inbox threads identity distinct from their grouping key
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.
Diffstat (limited to 'Hutch/App/RootView.swift')
-rw-r--r--Hutch/App/RootView.swift6
1 files changed, 3 insertions, 3 deletions
diff --git a/Hutch/App/RootView.swift b/Hutch/App/RootView.swift
index e223766..1ae4651 100644
--- a/Hutch/App/RootView.swift
+++ b/Hutch/App/RootView.swift
@@ -476,15 +476,15 @@ private struct MoreNavigationRoot: View {
ThreadDetailView(
thread: thread,
onViewed: {
- InboxReadStateStore.markViewed(max(Date(), thread.lastActivityAt), for: thread.id, defaults: appState.accountDefaults)
+ InboxReadStateStore.markViewed(max(Date(), thread.lastActivityAt), for: thread.threadGroupingKey, defaults: appState.accountDefaults)
NeedsAttentionSnapshotStore.adjustUnreadInboxThreads(by: -1, accountID: appState.activeAccountID)
},
onMarkRead: {
- InboxReadStateStore.markViewed(max(Date(), thread.lastActivityAt), for: thread.id, defaults: appState.accountDefaults)
+ InboxReadStateStore.markViewed(max(Date(), thread.lastActivityAt), for: thread.threadGroupingKey, defaults: appState.accountDefaults)
NeedsAttentionSnapshotStore.adjustUnreadInboxThreads(by: -1, accountID: appState.activeAccountID)
},
onMarkUnread: {
- InboxReadStateStore.markUnread(for: thread.id, defaults: appState.accountDefaults)
+ InboxReadStateStore.markUnread(for: thread.threadGroupingKey, defaults: appState.accountDefaults)
NeedsAttentionSnapshotStore.adjustUnreadInboxThreads(by: 1, accountID: appState.activeAccountID)
}
)