From 6221beaa38cd84969de4e1930f75855cf2e9b49d Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:57:10 +1000 Subject: [PATCH] fix(desktop): bind CPU exports to their capture sources --- packages/desktop/src/main/browser/profiling.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/desktop/src/main/browser/profiling.ts b/packages/desktop/src/main/browser/profiling.ts index 2a120938de5..f8e27b25ba1 100644 --- a/packages/desktop/src/main/browser/profiling.ts +++ b/packages/desktop/src/main/browser/profiling.ts @@ -56,11 +56,10 @@ export function createProfiling(contents: WebContents, cdp: Cdp, files: BrowserF ), ) if (cpu.result) return cpu.result + const resources = cpu.resources clearTimeout(cpu.timer) cpu.result = cdp.send("Profiler.stop").then(async ({ profile }) => ({ - id: await files.save("profile.cpuprofile", "application/json", Buffer.from(JSON.stringify(profile)), [ - ...(cpu?.resources ?? []), - ]), + id: await files.save("profile.cpuprofile", "application/json", Buffer.from(JSON.stringify(profile)), [...resources]), durationMs: (profile.endTime - profile.startTime) / 1000, })) return cpu.result