From 7f62ff0d7604e5bb85e147749618a7503d6e767f 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 9dcd0dd7c..bb82b673a 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