From 962395e4eabaf3da2aca0c52c4801a4822ecea9a Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 30 May 2026 12:25:42 -0700 Subject: [PATCH] Remove diagnostics bundle ref mirror effect (#3176) --- .../src/components/settings/PrivacyDiagnosticsSection.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx b/src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx index 107f2ec3a00..67ecbb7b215 100644 --- a/src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx +++ b/src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx @@ -52,10 +52,6 @@ export function PrivacyDiagnosticsSection(): React.JSX.Element { } }, []) - useEffect(() => { - activeBundleSubmissionIdRef.current = bundle?.bundleSubmissionId ?? null - }, [bundle]) - const handleOpenFolder = useCallback(async (): Promise => { try { await window.api.diagnostics.openTraceFolder() @@ -91,6 +87,9 @@ export function PrivacyDiagnosticsSection(): React.JSX.Element { await window.api.diagnostics.discardBundlePreview(nextBundle.bundleSubmissionId) return } + // Why: unmount cleanup may run before a passive ref mirror would fire; + // keep the retained preview id in sync at the creation/clear sites. + activeBundleSubmissionIdRef.current = nextBundle.bundleSubmissionId setBundle(nextBundle) setPreviewOpened(false) setTicketId(null)