From 788575e300cb24d2bee7ecd7bb014f05304efe88 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 24 Aug 2026 21:03:34 -0700 Subject: [PATCH] fix(crash-reporting): stop destroying user crash notes (#15252) --- src/main/ipc/crash-reporting.test.ts | 3 +- .../crash-report/CrashReportDialogSurface.tsx | 25 +- src/shared/crash-report-redaction.ts | 109 +++++++++ src/shared/crash-reporting.test.ts | 230 +++++++++++++++++- src/shared/crash-reporting.ts | 142 ++++------- 5 files changed, 395 insertions(+), 114 deletions(-) create mode 100644 src/shared/crash-report-redaction.ts diff --git a/src/main/ipc/crash-reporting.test.ts b/src/main/ipc/crash-reporting.test.ts index 86867659302..c7495634db1 100644 --- a/src/main/ipc/crash-reporting.test.ts +++ b/src/main/ipc/crash-reporting.test.ts @@ -138,7 +138,7 @@ describe('registerCrashReportingHandlers', () => { _resetRendererErrorReportDedupeForTests() }) - it('copies the latest pending diagnostic text to the clipboard', async () => { + it('copies the requested captured report to the clipboard', async () => { const latest = report() registerCrashReportingHandlers({ getById: vi.fn(async () => latest), @@ -151,6 +151,7 @@ describe('registerCrashReportingHandlers', () => { } as never) const result = await handlers.get('crashReports:copyLatestDiagnostics')?.(null, { + reportId: latest.id, notes: 'extra /Users/alice/project' }) diff --git a/src/renderer/src/components/crash-report/CrashReportDialogSurface.tsx b/src/renderer/src/components/crash-report/CrashReportDialogSurface.tsx index 94ffb8d342d..05ad8fff24e 100644 --- a/src/renderer/src/components/crash-report/CrashReportDialogSurface.tsx +++ b/src/renderer/src/components/crash-report/CrashReportDialogSurface.tsx @@ -16,6 +16,7 @@ import { useMountedRef } from '@/hooks/useMountedRef' import { formatCrashReportText, isReactErrorBoundaryReport, + MAX_USER_NOTES_LENGTH, type CrashReportDiagnosticBundle, type CrashReportRecord } from '../../../../shared/crash-reporting' @@ -277,13 +278,23 @@ export function CrashReportDialogSurface({ )} )} -