mattermost-community / mattermost-plugin-memes

Add culture to your Mattermost with memes 🔌

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated memes do not appear in iOS app

hmenzagh opened this issue · comments

Everything is in the title, just did a fresh install (Mattermost & mattermost-plugin-memes) works like a charm on desktop & web, but I get blank posts from the mobile version.

Do you see any errors in the server logs?

Nope, I haven't got anything, unless there is a config to change to see mattermost-plugin-memes's logs

I'm seeing the same problem on Android Mattermost. Memes with standard text appear fine, but if there's custom text it does not show any meme at all. Nothing in the logs unless you use a single quote in the text, then logs say "Unterminated single-quoted string"

Works perfectly on desktop and web.

Edit: memes v1.4.0
Edit 2: It's inconsistent. Sometimes they show up, sometimes they don't. Sometimes the identical meme and text will show up in one channel but not in another.

Seeing the same problem. Memes show up in Web and in Desktop Client, but not in IOS (stable and beta) and Android clients..

Here too…

Same here. memes v1.4.0 compiled on my machine. Server is 5.38.1, mobile is v1.46.
No logs in Mattermost server related to the plugin.

  • The image correctly loads if I go to the link in my mobile browser.
  • The image correctly loads if I replace MY_MATTERMOST_URL by the community.mattermost.com.
  • The image doesn't load if I copy-paste the post in my mobile app connected to community.mattermost.com.
  • The image doesn't load with a local mattermost server and a mobile app connected to this local server, with ServerURL correctly configured (so I think it is not a proxy issue)
![am-i-the-only-one](https://MY_MATTERMOST_URL/plugins/memes/templates/am-i-the-only-one.jpg?text=hello&text=you)

Some more troubleshooting informations: when querying the Mattermost API from my instance, the metadata field is empty, whereas in Mattermost Community, we have metadata for the image. For what I have seen in the React Native code, it's this metadata field which is used to render images.

Community.mattermost.com API response
{
  "id": "REDACTED",
  "create_at": 1633522416109,
  "update_at": 1633525971148,
  "edit_at": 1633525971148,
  "delete_at": 0,
  "is_pinned": false,
  "user_id": "REDACTED",
  "channel_id": "REDACTED",
  "root_id": "",
  "original_id": "",
  "message": "![ancient-aliens](https://community.mattermost.com/plugins/memes/templates/ancient-aliens.jpg?text=salut-2)",
  "type": "",
  "props": {
    "override_icon_url": ""
  },
  "hashtags": "",
  "pending_post_id": "",
  "reply_count": 0,
  "last_reply_at": 0,
  "participants": null,
  "metadata": {
    "images": {
      "https://community.mattermost.com/plugins/memes/templates/ancient-aliens.jpg?text=salut-2": {
        "width": 500,
        "height": 436,
        "format": "jpeg",
        "frame_count": 0
      }
    }
  }
}

@SHAZM Maybe you can chime here as this a mobile issue?

I'll have a look and see if I can find what the issue is

Hi @SHAZM, have you any clues about the cause of this issue? I can confirm it still happens on Mattermost v6.4.0 and mobile v1.49.0.

I've done a bit of digging and there isn't really anything on the mobile side that's preventing the images from being shown; I think there's likely something in the generator; combinations of the images / texts or formatting it doesn't like.

@nathanaelhoun, @hanzei, @moschlar, @Twilek-de, @kevinbosman, @hmenzagh - could you give me the commands you run; i.e. /meme alien "aliens man!" that always fails for you? And also let me know:

  • Are you running the slash command on web, ios or android?
  • If web, does it work on web and not come up on ios or android?
  • Or if ios / android, does it fail altogether (not come up on web?)

I'll try digging into the plugin repo; I have a sneaky suspicion that some image formats might not actually be supported that are coming back from the generator, and the generator also fails for some specific uses of text / memes (#48)

Hi @SHAZM, thanks for digging into this!
I tried the command /meme ancient-aliens "Aliens man!", a variation with several arguments /meme ancient-aliens "Aliens" "man!" and without argument /meme ancient-aliens.
In each case, both sent from mobile (android) or web :

  • the command doesn't fail (no error message, no server log, the message is sent).
  • On web, the meme shows correctly with the good text or no text if without argument.
  • On Android, there is an "empty" message, without any text or image showing, just a small empty space.

Hope it helps!

This bug exists on both iOS and Android.

This bug exists now for two years?

I think I've found the issue... And it's a stupid one...

tl:dr;

The mobile-app does not support markdown images!

The full story

After a somewhat short debugging session I discovered that this plugin is sending the images as markdown.
First I though that it might be due to multiple domains on the same server (havn't ruled that one out yet), but if I manually send a message with markdown, that's supposed to display an image, it doesn't work in the mobile-app, but works fine on desktop (web and app).
And it is not due too total lack of markdown support in the mobile-app, because headers, list and hightlighting works, just images that's not working.
Don't know if this means that we have to submit the bug elsewhere....
The links that this plugin embeds in the messages hardcode the domain for the server, that's why I'm not sure if that might cause issues.