{"record":{"id":"4764d44efa92712e","repo":"Foundry376/Mailspring","slug":"thumbnail-generation-webcontents-crashed-reason","errorCode":null,"errorMessage":"Thumbnail generation webcontents crashed (reason: ${details.reason}).","messagePattern":"Thumbnail generation webcontents crashed \\(reason: (.+?)\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/quickpreview/index.ts","lineNumber":350,"sourceCode":"      preload: path.join(filesRoot, 'preload.js'),\n      nodeIntegration: false,\n      contextIsolation: true,\n      partition: QuickPreviewPartition,\n    },\n  });\n\n  // Apply Content Security Policy to the quickpreview partition only\n  win.webContents.session.webRequest.onHeadersReceived((details, callback) => {\n    callback({\n      responseHeaders: {\n        ...details.responseHeaders,\n        'Content-Security-Policy': [QuickPreviewCSP],\n      },\n    });\n  });\n\n  win.webContents.on('render-process-gone', (event, details) => {\n    console.warn(`Thumbnail generation webcontents crashed (reason: ${details.reason}).`);\n    if (captureWindow === win) captureWindow = null;\n    win.destroy();\n  });\n  win.once('closed', () => {\n    if (captureWindow === win) captureWindow = null;\n  });\n  return win;\n}\n\nasync function _generateNextCrossplatformPreview() {\n  if (captureQueue.length === 0) {\n    // Don't tear down the window if a generation is already in progress — that\n    // invocation will schedule the next call to _generateNextCrossplatformPreview\n    // once it finishes, which will then reach this branch and clean up properly.\n    if (!captureWindowInUse) {\n      if (captureWindow && !captureWindow.isDestroyed()) {\n        captureWindow.destroy();\n      } else {","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/quickpreview/index.ts#L332-L368","documentation":"Warning from the quickpreview capture window's render-process-gone handler: the hidden BrowserWindow used to render attachment thumbnails crashed (reason from Electron, e.g. OOM or GPU crash). The in-flight thumbnail is abandoned; queued items may stall since the capture never completes.","triggerScenarios":"Thrown at app/src/quickpreview/index.ts:350 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Let the queue retry — subsequent previews get a fresh window","Disable GPU acceleration for the capture window if crashes recur (reason 'gpu-process-crashed')","Regenerate the thumbnail on demand when the user re-opens the preview"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}