mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.2k stars 1.33k forks source link

Android app crash every time trying to view image in markdown table #7189

Closed svenssonaxel closed 1 week ago

svenssonaxel commented 1 year ago

Summary

Android app crashes every time trying to view a markdown table that contains an inline image. Perhaps related to #2568?

Environment Information

See screenshot

Steps to reproduce

Send a message containing a markdown table that contains an inline image. View that channel in the Android Mobile App.

Expected behavior

Table and image is shown

Observed behavior (that appears unintentional)

See screenshot

svenssonaxel commented 1 year ago

Screenshot_20230307-172305

Screenshot_20230307-171604

amyblais commented 1 year ago

@svenssonaxel Are you open to downloading the Beta app (instructions here https://mattermost.com/blog/mobile-beta-program-v2/) to see if the issue reproduces on our latest build (build number 460)?

svenssonaxel commented 1 year ago

Reproduced.

Screenshot_20230307-182120

Screenshot_20230307-182038

enahum commented 1 year ago

Just as a sanity check, does the inline image shows up in a regular message?

svenssonaxel commented 1 year ago

@enahum Turns out, that was a good sanity check!

Test message contents

Test 1:

![](/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)

Test 2:

![](https://domain.name.redacted/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)

Test 3:

![](https://domain.name.redacted/api/v4/files/w35t17xzu3875mpn54taqrsmuo)

Test 4:

|A|B|C|
|-|-|-|
|a|![](/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)|c|

Test 5:

|A|B|C|
|-|-|-|
|a|![](https://domain.name.redacted/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)|c|

Test 6:

|A|B|C|
|-|-|-|
|a|![](https://domain.name.redacted/api/v4/files/w35t17xzu3875mpn54taqrsmuo)|c|

Test 7:

![](/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)

Test 8:

![](https://domain.name.redacted/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)

Test 9:

![](https://domain.name.redacted/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character.png)

Test 10:

|A|B|C|
|-|-|-|
|a|![](/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)|c|

Test 11:

|A|B|C|
|-|-|-|
|a|![](https://domain.name.redacted/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)|c|

Test 12:

|A|B|C|
|-|-|-|
|a|![](https://domain.name.redacted/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character.png)|c|

Test 13:

|A|
|-|
|![](/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)|
|![](/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)|

Test 14:

|A|
|-|
|![](https://domain.name.redacted/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)|
|![](https://domain.name.redacted/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)|

Test 15:

|A|
|-|
|![](/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)|

Test 16:

|A|
|-|
|![](https://domain.name.redacted/api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail)|

Test 17:

|A|
|-|
|![](/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)|

Test 18:

|A|
|-|
|![](https://domain.name.redacted/plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg)|

Results

In tests 1-3:

In tests 4-6:

In tests 7-9:

In test 10:

In tests 11-12:

In tests 13-14:

In tests 15-16:

In test 17:

In test 18:

Summary

Test images

For reference, the test images are as follows:

URI Path as used in the examples SHA256 sum
https://user-images.githubusercontent.com/163858/223685408-f5621269-8d79-4391-b784-3ecf5ab25b43.jpg /api/v4/files/w35t17xzu3875mpn54taqrsmuo/thumbnail 6d336b79eb88a2235d9cbfefdf67af3c1991fd5f1e4c2f6f26375b1227241c03
https://user-images.githubusercontent.com/163858/223685410-3bce0d9e-aadb-43cd-91f8-02753630f2a6.jpg /api/v4/files/w35t17xzu3875mpn54taqrsmuo 7abdb589b2ac1fb7cc9f857bf946bf6c80f588d7aa132dab8ba079fb09ed3f4c
https://user-images.githubusercontent.com/163858/223685401-95ef49a6-bb90-46c7-9d16-071083495e95.jpeg /plugins/com.axelsvensson.mattermost-plugin-character-profiles/character-thumbnail.jpeg 0001d4d21b83b288dd55c0d26d70e590c3f193a89cc883777148555e264b9656
https://user-images.githubusercontent.com/163858/223685415-c52315fd-c1b8-4429-a40c-7caae21f1322.png /plugins/com.axelsvensson.mattermost-plugin-character-profiles/character.png 177c8a94bc3c09ed82da70096c98e7940f0eb7ab2c1c2dd74a1db8e93e239d50

Potentially separate bugs

svenssonaxel commented 1 year ago

@amyblais @enahum Any update?

amyblais commented 1 year ago

Opened https://mattermost.atlassian.net/browse/MM-51731.