mujx / nheko

No longer maintained - Desktop client for the Matrix protocol (active fork https://github.com/Nheko-Reborn)
GNU General Public License v3.0
394 stars 65 forks source link

Loading the backlog is broken for deleted messages #168

Closed ollieparanoid closed 6 years ago

ollieparanoid commented 6 years ago

System:

Actual behavior

There was an IRC spambot in the channel, and it left lots of spam messages. Another user in the channel removed all of them (they show up as lots of single deleted lines in Riot). When scrolling up to see the backlog in nheko it loads fine until the last message is "ok all spam messages removed... pfft what a work".

Expected behavior

Scrolling up works even with removed messages.

Steps to reproduce

I guess creating one or more deleted messages (messages can be deleted in Riot) followed by lots of normal messages, then open nheko and try to scroll up above the deleted message.

mujx commented 6 years ago

I am not sure I understand the problem here. Did you expect to see the deleted messages or the issue is that the scrollbar doesn't move any further.

alphapapa commented 6 years ago

@mujx I think nheko isn't handling redaction events. I saw some JSON dumps in the console today from a room I was in, saying "Invalid event type".

PureTryOut commented 6 years ago

@mujx the problem is that the scrollbar doesn't move further. I was the one deleting the messages @ollieparanoid mentioned, and I already noticed it didn't scroll up further (immediately after deleting the message, no other messages after the deletion are necessary).

mujx commented 6 years ago

@PureTryOut @ollieparanoid Are you able to reproduce the issue in another room?

PureTryOut commented 6 years ago

I just created a test room, and it seems I can not, which is interesting. Obviously nheko didn't remove the message on the timeline, but after a restart the deleted message was gone and the message before it was loaded fine. What is weird though is that some messages appear as a new user.

screenshot_2017-12-23_14-35-08

However, that has nothing to do with this issue.

mujx commented 6 years ago

The user avatar appears again because each message chunk is rendered independently of the previous messages.

mujx commented 6 years ago

Not sure if this is relevant https://github.com/vector-im/riot-web/issues/5845. Maybe we can reproduce the error after deleting a lot of messages.

mujx commented 6 years ago

I was able to reproduce this error in a room that had a lot of messages deleted (#ruma:matrix.org).

The /messages endpoint can sometimes return 0 events even though the next call would return a non zero number of events. Nheko interprets 0 events as if the timeline is over for that room and it stops fetching more messages.

mujx commented 6 years ago

The bug is in nheko. If a batch only contains m.room.redaction events they will not be parsed. I will update the parsing to include those events.

ollieparanoid commented 6 years ago

Unfortunately that bug appeared again today. There are quite some pages of backlog which I scroll through, and then I can't scroll up further anymore. Checking in the Riot web interface, a deleted message is exactly at that location.

System