From 1cf039147e46260c2952328529ec7a41cec22c6b Mon Sep 17 00:00:00 2001 From: Filipe Guerreiro Date: Thu, 17 Sep 2026 15:48:49 +0900 Subject: [PATCH] perf: stop structural sharing from walking the whole inbox Marking a notification froze the renderer for 8.5s on a 1274-notification inbox: every cache write deep-compared the enriched tree. --- src/renderer/hooks/useNotifications.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/hooks/useNotifications.ts b/src/renderer/hooks/useNotifications.ts index bb6af5e67..73eb2d783 100644 --- a/src/renderer/hooks/useNotifications.ts +++ b/src/renderer/hooks/useNotifications.ts @@ -183,6 +183,9 @@ export const useNotifications = ({ placeholderData: keepPreviousData, + // Deep-walks every cached notification per write; dominates cost on large inboxes. + structuralSharing: false, + // Fresh for at least one poll cycle at the fastest possible interval, so // data isn't treated as stale before a refetch could realistically have // occurred. Uses the static floor rather than the live interval because