element-android
element-android copied to clipboard
Reply messages are sometimes not displayed
Steps to reproduce
- Setup a standard Home-Server (Synapse) and Mautrix-Discord.
- Start a chat with someone on Discord, make them reply to your messages.
- 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
This happens to me in non-bridged rooms too.
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.?
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
:
When replying with image:
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 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.
It also seems to fail if the reply is an image, which doesn't have the format
field at all.
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.
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.
Same issue here! Samsung S22 Ultra with Android 13
Element: Version: 1.5.32 [40105322] (G- 8dcb5f70) Matrix SDK: 1.5.32 (8dcb5f70)
Hello, Same issue using signal bridge (issue https://github.com/mautrix/signal/issues/384 )
Element version 1.6.10
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)
Happening to me as well in an Android Phone Version 1.6.10
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 :)
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