Foundry376/Mailspring · error

Thumbnail generation timed out for ${filePath}

Error message

Thumbnail generation timed out for ${filePath}

What it means

Warning in the quickpreview queue: rendering the attachment in the capture window raced against a 5-second timer and lost — the thumbnail request for filePath is abandoned and its loadFile is aborted (surfacing an expected ERR_ABORTED). Slow-rendering files (huge PDFs/images) hit this regularly.

Source

Thrown at app/src/quickpreview/index.ts:420

  // Start the thumbnail generation
  captureWindow
    .loadFile(path.join(filesRoot, 'renderer.html'), {
      search: JSON.stringify({ strategy, mode: 'capture', filePath, previewToken }),
    })
    .catch((err: Error) => {
      // ERR_ABORTED is expected when a new preview starts while the previous is still loading
      // (e.g. after the 5-second timeout fires). The thumbnail just won't be generated.
      if (!err?.message?.includes('ERR_ABORTED')) {
        console.error('Quickpreview capture window failed to load:', err);
      }
    });

  // Race against a timer to complete the preview. We don't want this to hang
  // forever if for some reason the window encounters an exception
  let onFinalize = null;

  const timer = setTimeout(() => {
    console.warn(`Thumbnail generation timed out for ${filePath}`);
    onFinalize(false);
  }, 5000);

  const onRendererSuccess = () => {
    onFinalize(true);
  };

  onFinalize = (success) => {
    captureWindowInUse = false;
    clearTimeout(timer);
    if (captureWindow) {
      captureWindow.removeListener('page-title-updated', onRendererSuccess);
    }
    // Clean up the token if preview failed (on success, IPC handler deletes it)
    if (!success) {
      cleanupPreviewToken(previewToken);
    }
    process.nextTick(_generateNextCrossplatformPreview);

View on GitHub (pinned to 648c685d60)

Solutions

  1. Retry generating the preview — often the second pass renders faster from cache
  2. Increase the race timeout for large attachments
  3. Pre-generate or downsample oversized files before capture
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at app/src/quickpreview/index.ts:420 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03). Data as JSON: /api/errors/a25c348c55e24d10. Report an issue: GitHub.