desktop: [Bug]: Downloading an SVG leads to error "Failed to get thumbnail from local thumbnail cache reference"

Checks before filing an issue

Mattermost Desktop Version

5.9.0

Operating System

Windows 11 x64

Mattermost Server Version

EE 9.5.6

Steps to reproduce

  • Navigate to a chat with SVG images attached
  • Click on the Download icon of that SVG image

image

Expected behavior

  • SVG is successfully downloaded
  • No error message is shown and Mattermost does not need to restart

Observed behavior

  • SVG is successfully downloaded (yes, actual download works)
  • An error message is shown (see below) and Mattermost has to be restarted

image

Log Output

Application: Mattermost 5.9.0
Platform: Windows_NT 10.0.22631 x64
Error: Failed to get thumbnail from local thumbnail cache reference
    at C.formatDownloadItem (C:\Users\martin\AppData\Local\Programs\mattermost-desktop\resources\app.asar\index.js:2:258206)
    at C.upsertFileToDownloads (C:\Users\martin\AppData\Local\Programs\mattermost-desktop\resources\app.asar\index.js:2:255614)
    at C.doneEventController (C:\Users\martin\AppData\Local\Programs\mattermost-desktop\resources\app.asar\index.js:2:256970)
    at DownloadItem.<anonymous> (C:\Users\martin\AppData\Local\Programs\mattermost-desktop\resources\app.asar\index.js:2:254776)
    at Object.onceWrapper (node:events:634:26)
    at DownloadItem.emit (node:events:519:28)

Additional Information

  • Tested on the web interface (current Firefox) and the issue does not show up there.
  • Downloading a different file type (JSON) works, no issues.
  • Downloading an image (PNG) works as well. But here the UX is different, as I first have to click on the image to show it and, when it’s shown, I can click the download button shown at the top-right.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 22 (6 by maintainers)

Most upvoted comments

My Desktop Mattermost crash too when I try to download a png or jpeg file but the error is different, I don’t know if this is related to the same issue.

I’m on Manjaro with kernel 6.10 Mattermost 5.9.0 Desktop

Application: Mattermost 5.9.0 [commit: 5.9.0]
Platform: Linux 6.10.6-10-MANJARO x64
TypeError: s.nativeImage.createThumbnailFromPath is not a function
    at C.formatDownloadItem (/usr/lib/mattermost-desktop/app.asar/index.js:2:258337)
    at C.upsertFileToDownloads (/usr/lib/mattermost-desktop/app.asar/index.js:2:255745)
    at C.doneEventController (/usr/lib/mattermost-desktop/app.asar/index.js:2:257101)
    at DownloadItem.<anonymous> (/usr/lib/mattermost-desktop/app.asar/index.js:2:254907)
    at Object.onceWrapper (node:events:634:26)
    at DownloadItem.emit (node:events:519:28)

@Annavar-satish that is a different issue and got solved via #3129, as stated by @devinbinnie before. That fix is not released yet though (we are still at 5.9.0, 5.9.1 and 5.10.0 should contain the fix).

FWIW this seems to be an error internal to Windows, that seems to be hard crashing: https://github.com/electron/electron/blob/main/shell/common/api/electron_api_native_image_win.cc#L69

So just catching it seems to be the best option.

Well I tested that SVG and it doesn’t seem to be that particular file, so I’m guessing it is some strange issue in the Chromium image cache…we can probably just add a crash catch there and just not load a thumbnail if it fails.

Ticket here: https://mattermost.atlassian.net/browse/MM-61919

I am Facing the same issue while downloading the jpg,svg etc., Mattermost Desktop Version 5.9.0

Operating System x86_64 GNU/Linux

Mattermost Server Version CE 9.11.1

Electron Version 31.6.0-2

Looks like Issues with the electron version

Application: Mattermost 5.9.0 [commit: 5.9.0
]
Platform: Linux 6.11.2-zen1-1-zen x64
TypeError: s.nativeImage.createThumbnailFromPath is not a function
    at C.formatDownloadItem (/usr/lib/mattermost-desktop/app.asar/index.js:2:258337)
    at C.upsertFileToDownloads (/usr/lib/mattermost-desktop/app.asar/index.js:2:255745)
    at C.doneEventController (/usr/lib/mattermost-desktop/app.asar/index.js:2:257101)
    at DownloadItem.<anonymous> (/usr/lib/mattermost-desktop/app.asar/index.js:2:254907)
    at Object.onceWrapper (node:events:634:26)
    at DownloadItem.emit (node:events:519:28)