element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Reply messages are sometimes not displayed

Open SakulFlee opened this issue 2 years ago • 13 comments

Steps to reproduce

  1. Setup a standard Home-Server (Synapse) and Mautrix-Discord.
  2. Start a chat with someone on Discord, make them reply to your messages.
  3. View the reply message on Element-Android.

Outcome

What did you expect?

On Web and Desktop, the message is rendered correctly and can be read. This is to be expected on the Android side too.

What happened instead?

The reply message appears blank and can't be read.

I've detailed and made a demonstration over on Mautrix-Discord's repository, which can be viewed here (#59).

What I found so far is that inside the source of the reply over on Matrix the content.format and content.formatted_body fields are missing. Which I am guessing the Android Client expects (but Web and Desktop doesn't?). The message is there, in the source view, and when replying to the "empty reply" it also shows up in the preview above the input field, but it won't display inside the chat.

I've also filed a bug inside the App with logs. I'll happily provide more information and, if possible, fix this myself if I know where to start :)

Your phone model

Samsung A13

Operating system version

Android 13

Application version and app store

Element version 1.5.25 [40105251] (G-f74a885a), Matrix SDK 1.5.25 (f74a885a), OLM version 3.2.12 from Google PlayStore

Homeserver

Selfhosted Synapse server version 1.71.0-r0; hosted on matrix.sakul-flee.de, federated

Will you send logs?

Yes

Are you willing to provide a PR?

Yes

SakulFlee avatar Feb 22 '23 17:02 SakulFlee

This happens to me in non-bridged rooms too.

noClaps avatar Mar 04 '23 19:03 noClaps

Interesting, this suggests it not being related to the bridge but some issue on the Android-App and/or Matrix server.

@noClaps Would you be so kind to share relevant information like the "source" of those messages, which homeserver, version of homeserver, etc.?

SakulFlee avatar Mar 05 '23 00:03 SakulFlee

I'm on the matrix.org homeserver, which I'm assuming is on the latest version.

I definitely think this is a client issue, as I don't experience this on other Matrix clients like Fluffychat.

When replying with /me message: Screenshot_20230305-003120~3

Screenshot_20230305-003504~2

When replying with image: Screenshot_20230305-003544~4

Screenshot_20230305-003839

I'm not sure if this is what you're looking for when you said "source". If it's something else, please let me know.

noClaps avatar Mar 05 '23 00:03 noClaps

@noClaps That's exactly what I wanted to see, thank you!

I believe this also confirms my suspicion that, for some reason, if the format field is set to org.matrix.custom.html (or empty), the Android App fails to display it properly.

SakulFlee avatar Mar 05 '23 16:03 SakulFlee

It also seems to fail if the reply is an image, which doesn't have the format field at all.

noClaps avatar Mar 05 '23 16:03 noClaps

I'm encountering this very frequently as well. An interesting workaround is to long press on the "empty" message, and the content seems to display in the menu preview.

AmineI avatar Apr 12 '23 15:04 AmineI

I'm having this issue as well. Especially the images do not show up in the Element Android version (on Android 11), when the user adds an image into reply message of existing message. In the desktop/web version of the Element this works just fine, though.

wapsi avatar Jun 01 '23 12:06 wapsi

Same issue here! Samsung S22 Ultra with Android 13

Element: Version: 1.5.32 [40105322] (G- 8dcb5f70) Matrix SDK: 1.5.32 (8dcb5f70)

vrozaksen avatar Jun 03 '23 08:06 vrozaksen

Hello, Same issue using signal bridge (issue https://github.com/mautrix/signal/issues/384 )

Element version 1.6.10

tduboys avatar Jan 29 '24 14:01 tduboys

I'm experiencing this consistently with every reply in bridged rooms. My own replies are displayed, but replies from other bridged users are not. Replies are only missing from the room views; they are visible in the room preview in the list of rooms.

Replies are visible on desktop and web for me as well.

Version: 1.6.10 [40106102] (G-493093c2)

cmbarba avatar Feb 06 '24 14:02 cmbarba

Happening to me as well in an Android Phone Version 1.6.10

xarxaxdev avatar Feb 12 '24 12:02 xarxaxdev

FYI: As a workaround I'm using SchildiChat now (https://schildi.chat/), which is Element fork with some extra features/fixes applied. For instance, this issue does not happen on SchildiChat at all :)

wapsi avatar Feb 14 '24 06:02 wapsi

This issue destroyed the usability of element for me, so here is a one-line temporary fix I've been using. Tested out with all my bridges and couldn't notice any side effects, but I just made this in a few minutes so who knows.

https://github.com/element-hq/element-android/blob/95e1bcbf64a3fd2adb52f29e497be6ab5b8d06a2/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/decorator/UpdatedReplyDecorator.kt#L62

-  .bodyForReply(currentTimelineEvent.getLastMessageContent(), true).formattedText ?: ""
+  .bodyForReply(currentTimelineEvent.getLastMessageContent(), true).takeFormatted()

Note that this is not an issue for other clients such as Element X or SchildiChat, so it would be better to cherry-pick from their implementations if anyone has the time and knowledge to dig deeper. Issue is related to #8162 and its variants

AmineI avatar Jul 25 '24 01:07 AmineI