Foundry376/Mailspring · error
Thumbnail generation finished but window is already destroye
Error message
Thumbnail generation finished but window is already destroyed.
What it means
Warning during quickpreview queue drain: a thumbnail generation cycle finished, but the capture window was destroyed in the meantime (timeout fired, cleanup ran, or the queue emptied), so the ready bitmap cannot be captured from it. The preview is skipped rather than crashing.
Source
Thrown at app/src/quickpreview/index.ts:369
if (captureWindow === win) captureWindow = null;
win.destroy();
});
win.once('closed', () => {
if (captureWindow === win) captureWindow = null;
});
return win;
}
async function _generateNextCrossplatformPreview() {
if (captureQueue.length === 0) {
// Don't tear down the window if a generation is already in progress — that
// invocation will schedule the next call to _generateNextCrossplatformPreview
// once it finishes, which will then reach this branch and clean up properly.
if (!captureWindowInUse) {
if (captureWindow && !captureWindow.isDestroyed()) {
captureWindow.destroy();
} else {
console.warn(`Thumbnail generation finished but window is already destroyed.`);
}
captureWindow = null;
}
return;
}
const { strategy, filePath, previewPath, resolve } = captureQueue.pop();
// Mark the window as in-use before the async token generation so that a
// concurrent invocation reaching the queue-empty branch above does not
// destroy the window while we are suspended at the await below.
captureWindowInUse = true;
// Generate an opaque token for the preview path instead of passing the path directly
// Token is generated via IPC to ensure it's stored in the main process
let previewToken: string;
try {
previewToken = await generatePreviewToken(previewPath);View on GitHub (pinned to 648c685d60)
Solutions
- No action needed for a one-off — the preview falls back to no thumbnail
- If previews never render, check whether the 5-second timeout is too short for large files and raise it
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at app/src/quickpreview/index.ts:369 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03).
Data as JSON: /api/errors/b847feb753484fb0.
Report an issue: GitHub.