diff --git a/dsh-plugin-desktop/src/electron-runtime.ts b/dsh-plugin-desktop/src/electron-runtime.ts index f681580f32..8be3fd6a78 100644 --- a/dsh-plugin-desktop/src/electron-runtime.ts +++ b/dsh-plugin-desktop/src/electron-runtime.ts @@ -268,6 +268,7 @@ export class ElectronDesktopRuntime implements DesktopRuntime { const path = await exportDiagnosticsZip( join(app.getPath('userData'), 'logs'), app.getPath('userData'), + { crashDumpsDir: app.getPath('crashDumps') }, ) shell.showItemInFolder(path) } catch (cause) { diff --git a/dsh-plugin-desktop/src/tray-locale.ts b/dsh-plugin-desktop/src/tray-locale.ts index 8dfb4bccbc..d1f324da33 100644 --- a/dsh-plugin-desktop/src/tray-locale.ts +++ b/dsh-plugin-desktop/src/tray-locale.ts @@ -59,14 +59,14 @@ const diagnosticsPrivacyCopy: Record { app: { dock: { setIcon: vi.fn() }, getLocale: vi.fn(() => 'en-US'), - getPath: vi.fn(() => '/tmp/dsh-desktop-user-data'), + getPath: vi.fn((name: string) => name === 'crashDumps' + ? '/tmp/dsh-desktop-user-data/Crashpad' + : '/tmp/dsh-desktop-user-data'), getVersion: vi.fn(() => '43.4.0'), isPackaged: false, on: vi.fn(), @@ -620,6 +622,11 @@ describe('Electron compatibility runtime', () => { await Promise.all([first, second]) expect(diagnostics.export).toHaveBeenCalledOnce() + expect(diagnostics.export).toHaveBeenCalledWith( + join('/tmp/dsh-desktop-user-data', 'logs'), + '/tmp/dsh-desktop-user-data', + { crashDumpsDir: '/tmp/dsh-desktop-user-data/Crashpad' }, + ) expect(electron.shell.showItemInFolder).toHaveBeenCalledOnce() expect(electron.shell.showItemInFolder).toHaveBeenCalledWith('C:\\Users\\Example\\diagnostics.zip') }) @@ -640,6 +647,9 @@ describe('Electron compatibility runtime', () => { buttons: ['Export', 'Cancel'], detail: expect.stringContaining('local paths, workspace IDs, and session IDs'), })) + expect(electron.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({ + detail: expect.stringContaining('process memory'), + })) }) it('localizes the diagnostics privacy confirmation', async () => { @@ -654,6 +664,9 @@ describe('Electron compatibility runtime', () => { buttons: ['导出', '取消'], detail: expect.stringContaining('本地路径、工作区 ID 和会话 ID'), })) + expect(electron.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({ + detail: expect.stringContaining('进程内存'), + })) }) it('shows a native error when diagnostic export fails', async () => {