SharePoint Adaptive Cards (SPFx ACE) - Base64 Images only render correctly once in Firefox #10064
Open
4 of 9 tasks
Labels
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
Additional environment details
npm install @microsoft/generator-sharepoint@latest --global
andyo @microsoft/sharepoint
Describe the bug / error
Using an SPFx ACE to render images via base64 has issues, specifically with Firefox.
Using a brand new project created via
yo @microsoft/sharepoint
, and updating the JSON Adaptive Card QuickView schema to include a base64 image, will result in an Adaptive Card quick view where the image only works the first time the Quick View is opened, and will be a broken image on subsequent requests.Digging into this further, I found the following reason as to why this is happening. Observe the following image result in the raw HTML outputted:
src
is correctly the base64 contents)Going further into this, the URL that's getting replaced for subsequent openings of the quick view contains a base64-encoded URL of
https://mySharePointSite.sharepoint/com/data:image/jpeg;base64,---base64ImageHere---
NS_ERROR_NET_INTERRUPT
, and no response coming back from the server. These differences might be due to image size, but this element of it is currently unclear, although the same ultimate result occurs for the user in the Firefox browserSomewhat more odd, if I hard-refresh the page for Firefox,
ctrl+F5
, the quick view will work perfectly fine every time, until I do a soft-refresh or navigate away from the page and return, at which time the bug happens again.Steps to reproduce
yo @microsoft/sharepoint
QuickViewTemplate.json
where the URL is a base 64 image (replace the url with a properly formatted base64 image{ "schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.5", "body": [ { "type": "Image", "url": "data:image/jpeg;base64,Base64ImageHere" } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json" }
gulp serve
and if required open the resultant workbench URL in FirefoxThe same issue will not occur in Edge/Chrome and the image works everytime without issue.
NOTE: The same URL failure does occur in Edge/Chrome too, and I'm unaware where that call is coming from, but it doesn't try to use it in the DOM like Firefox does.
Expected behavior
The Image appears correctly every time the Quick View button has been pressed.
The text was updated successfully, but these errors were encountered: