element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
Apache License 2.0
3.32k stars 705 forks source link

Messages displayed incorrectly in threads (as compared to element web) #7857

Open enygmator opened 1 year ago

enygmator commented 1 year ago

Steps to reproduce

This is pretty difficult to reproduce as this seem to be some kind of intermittently occurring issue and has to do with the speed to which you send messages (some kind of consistency issue?). Steps to reproduce:

  1. Open the Element app, go to a chat and write a message, then create a thread using "reply in thread"
  2. When I start typing messages in that thread, everything seems fine.
  3. Try to reply to your OWN messages in that chat, preferably immediately after you write the initial message
  4. If you check our the other user's thread on element-web, everything appears perfectly
  5. Now switch over to the element-android, you may see that the messages show up in a very strange way.

NOTE: It doesn't happen everytime, especially not if you wait sometime before replying to your own message. Hard to reproduce, but happen enough times to make you lose your mind

The following screenshots are what you will observe:

web - user 1: ✅

web - user 2: ✅

Everything seems good? Now look at android - user 1: 🔴

Side effects

I have also noticed a side effect of this. On element-android, when "editing" a normal message, clicking the "edit" button will put the message in the textbox below, where you can edit it and hit the "tick" button to finish editing.

  1. BUT, when the messages are displayed incorrectly (the way it's shown above), hitting the "edit" button will show an empty textbox and whatever you write in there will replace the entire text in the message you are trying to edit.
  2. BUT, then the message seems to be correctly showing "In reply to a thread" on the phone.
  3. BUT, on element-web, it shows up even more weirdly.
  4. Then, editing on element-web will make things look normal on the web, but then android looks weird.

You can observe in following screenshots:

This is how the messages look on android (initially) (as you can see, they say they are in reply to something, but the UI is deformed and we don't know what).

android-iinitial: 🔴

Now, I'll make an edit on android by hitting the edit button. (The textbox is empty, so I type in whatever I want, and hit the "tick"). you can see the result after the edit on android: 🔴

Now, I'll show you how the edit looks on element-web. (⚠️ "In reply to" should not be shown on the element web ui, as it is not a feature of element web UI)

Now, I'll edit the SAME message on element-web: ✅

After I'm done editing on the web, it looks like this: ✅

Now, let's go back and see how the re-edit looks on android: 🔴 🔴 (what the hell happened here?)

As you can see, this whole thing seems like a real mess. I also uncovered another bug which I couldn't understand why it was happening. I'll create it later and maybe link it here. It may be related.

Summary

So, to summarize, the two issues are:

  1. BUG: the weird showing of "in reply to thread", as if it is a quote instead of showing up as a reply (reply is the right way to show in the UI, because I never used quote). This is a bug where a "reply" behaves like a "quote".
  2. SUGGESTION: Another fact is "in reply to thread" on element-android looks like a quote which is confusing. Element-web seems to be the perfect UI in the way it differentiates quotes (gray bar) and replies (red bar).
  3. SUGGESTION: in android, if someone replied to a message, and I want to see the original message to which they replied, I have to click exactly on the "In reply to thread" button. It would be much easier if it looked like how it does in whatsapp, where you just click on a whole box area to go that original message, rather than a particular line called "in reply to thread".
  4. BUG: the inability to edit properly and everything showing up strangely in UI. The experience on Element-web is impacted too, which otherwise actually seem to perform exactly as it should (no fault). - if element-android incorrectly edited the messages, then it also shows up weirdly on the web.

Thanks!

Outcome

What did you expect?

I'm sorry, I put the screentshots in "steps to reproduce"

What happened instead?

I'm sorry, I put the screentshots in "steps to reproduce"

Your phone model

Xiaomi Redmi Note 9

Operating system version

Android 11

Application version and app store

Element version 1.5.14, olm version 3.2.12 from playstore

Homeserver

matrix.org

Will you send logs?

Yes

Are you willing to provide a PR?

No

I CAN SHARE THE "decrypted even source" from "view source" just to see what was transferred over the wire IF YOU WANT

enygmator commented 1 year ago

I updated the description to properly describe the issues (bugs) and suggestions.