This issue has been created
There are 3 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-9501cf49-ba1d-48c1-b2d5-3495ce0a48ec XWIKI-25317 Open

Uploading an image from the attachment picker never completes when the browser cannot display it

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-fb98a04a-a089-45d6-ac03-e04f687ebca4 Claude created this issue on 16/Oct/26 21:42
 
Summary: Uploading an image from the attachment picker never completes when the browser cannot display it
Issue Type: cid:jira-generated-image-avatar-9501cf49-ba1d-48c1-b2d5-3495ce0a48ec Bug
Affects Versions: 11.5-rc-1
Assignee: Unassigned
Components: Attachments, Web - Templates & Resources
Created: 16/Oct/26 21:42
Priority: cid:jira-generated-image-static-major-402a5e8d-7fe1-4047-aa13-093c3013d0de Major
Reporter: Claude
Description:

Steps to reproduce

  1. Use a browser that cannot display TIFF images, e.g. Chrome, Firefox or Edge (Safari displays them).
  2. Open an attachment picker that allows uploading files, e.g. in the WYSIWYG editor insert an Office Document Viewer macro and use the picker of its attachment parameter.
  3. Choose "Upload a file ..." and upload a .tif image.

Expected result

The upload notification changes to "<file> uploaded successfully" and the uploaded attachment is displayed as uploaded in the picker (with the generic image icon if the browser cannot display its thumbnail).

Actual result

The file is uploaded and attached to the page, but the "Uploading <file>" notification never goes away and the picker keeps showing the attachment as being uploaded.

Cause

Before updating the display, the picker waits for the attachment thumbnail to be loaded (loadAttachmentIcon in uicomponents/attachments/icons.js, called from uicomponents/suggest/suggestAttachments.js). The promise is resolved only from the image onload handler; there is no onerror handler, so it never settles when the browser fails to load or decode the image.

The same happens for any image the browser cannot display: a corrupted image, or a format the browser doesn't support, such as JPEG XL in browsers that don't decode it yet (Edge, Firefox ESR, Chrome before 155, Firefox before 158).

The fix is to also resolve the promise when the image fails to load, so that the upload completes and the generic icon is used.

 
 

3 updates

 
cid:jira-generated-image-avatar-fb98a04a-a089-45d6-ac03-e04f687ebca4 Changes by Claude on 16/Oct/26 21:42
 
Assignee: Claude
 
cid:jira-generated-image-avatar-fddf8175-01e2-4393-b976-02dff07b73ce Changes by Clément Christiaens on 16/Oct/26 21:48
 
Reporter: Claude Clément Christiaens
Assignee: Claude Clément Christiaens