matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Backfilling on `/messages` causes odd behavior #2433

Open puckipedia opened 2 years ago

puckipedia commented 2 years ago

Background information

Description

Steps to reproduce

ShadowJonathan commented 2 years ago

Does this only appear when a json filter is attached, or does this also happen without any filter?

puckipedia commented 2 years ago

I believe this bug can apply in both cases, but they do so somewhat differently, and i'm not sure both fit in this one issue. When a filter is applied, this occurs consistently for me, but I've seen a very similar issue if doing a messages request near a backward extremity, fetching previous messages ends up with a non-sorted (and sometimes containing looping topological tokens) result due to all the backfilled events being added to the messages response, even if those events have the wrong topological depth. If it's useful, I could open a separate issue?

bones-was-here commented 2 years ago

Not sure if related, but in old versions it was often possible to scroll all the way back to the creation of a room in Element Web. That doesn't work in newer versions (at least any of 0.8.x). It will scroll back to a certain point, usually a few days or weeks of messages, depending how busy the room is. Beyond that it will either: keep jumping "randomly" to a newer point in the history, or will simply stop loading with no explanation or loading spinner, or will tell me I can't see messages before that point even when I definitely should have access to them.

S7evinK commented 2 years ago

@puckipedia could you try 0.8.9? https://github.com/matrix-org/dendrite/pull/2548 should fix some backfilling issues with /messages in combination with /context which caused strange behavior (in Element Web at least).

bones-was-here commented 2 years ago

I tested scrolling back in 0.8.9 with firefox autoscroll, needed to do a clear cache and reload first though, which caused a #2503.

It works much better than in previous 0.8.x versions, in some rooms I can reach room creation where I couldn't before.
But the issue where, at a certain point, Element will jump to a newer point, can still happen. I think it gets further back before it does that but it still isn't possible to reach room creation in rooms where that happens.

bones-was-here commented 2 years ago

It seems that in 0.9.5 the jumping issue in element web history is fixed, I can scroll back to the room creation in rooms where it wasn't possible before.