RNv2: Markdown images get posted without metadata

Start date

Due date

Description

Summary

Images sent as markdown do not display anything in the mobile app.
Originally reported here: mattermost-plugin-memes#issue41

Environment Information

  • Device Name: Sony xperia 5 III

  • OS Version: Android 13

  • Mattermost App Version: 2.1.0

  • Mattermost Server Version: 7.5.2

Steps to reproduce

Send an image (jpg/png) using markdown eg.

Expected behavior

The image should be displayed.
Currently it works fine for gif's, but normal images do not.

Observed behavior

The image does not appear in app.

Possible fixes

I tried sending the image as an attatchment instead, which worked for an uploaded file, but not for a url-linked image.

QA Test Steps

See description

Activity

Show:

Linda MitchellApril 25, 2023 at 4:38 AM

Verified as described on Pixel 5a Android 13, and iPhone 7 iOS 15.7.2 as well. Closing.

Claudio CostaApril 5, 2023 at 11:32 PM

Thanks Elias, looking at the server code I don't think any supported image type would load from a different URL when posted that way (markdown). I don't know exactly what the reporter is referring to but I'll try follow up on that.

is there anything that can be done to avoid the fact that the SiteURL may be different?

Honestly I think it may be best if the client covered this case if necessary since I don't think the server should mess with the connecting URL which is mostly a client-side detail. There may be security concerns as well to consider if we start touching that. Also to note, this sort of edge case is broken on web as well (

To fix this we could rewrite the base URL to be the actual one used by the client vs the one in the post metadata if there's a mismatch and the image proxy is enabled.

Elias NahumApril 5, 2023 at 9:29 PM

I’m currently on PTO and won’t be back until the 13th of April, what is interesting is that apparently there are certain images that work just fine (metadata present) while others don’t.

is there anything that can be done to avoid the fact that the SiteURL may be different?

Claudio CostaApril 5, 2023 at 7:27 PM

Had a good look at this and it seems like it's working as expected. The only case in which the image doesn't display is when using the image proxy and the hostname the client is connecting to is different from the one configured in SiteURL. This is because the generated image URL uses the SiteURL as base so requests from a different host would likely fail with an unauthorized error.

are you able to reproduce this issue when connecting to the configured siteURL?

Agniva De SarkerMarch 30, 2023 at 3:31 PM

- Checking if you have some spare cycles for this? This is also probably related to .

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

QA Assignee

Reporter

Checklist

Created February 24, 2023 at 6:20 PM
Updated January 30, 2025 at 4:26 PM
Resolved April 12, 2023 at 3:27 PM