You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sender profile is correct in scrollback but not in /sync (LL disabled) #7332
I joined #seaglass:matrix.org from @matthew:sandbox.modular.im. The scrollback for the room shows @neil:sandbox.modular.im with the correct avatar & displayname (Neil). But the messages added to the timeline subsequently have the wrong profile (no avatar, and displayname of neil).
and (in terms of #7335), there were no sentinels at all in the room.oldState (aka liveTimeline.startState). There was also no paginationToken at all in oldState, hence #7335.
We tried to repro this earlier but failed, but i think the key missing ingredient is that the room has to start off federated. This means that when the first local user joins, there isn't any DAG available to sync, so their join will have no history at all. When the second local user joins, they may only see the local room history if the remote stuff hasn't arrived yet - and if the second user doesn't even see the local room history, then it might only arrive via /messages, then that might explain why we have correct members in the history loaded by /messages, but not in the ongoing forward-paginating timeline.
Fwiw, this feels like a sentinel bug to me:that riot propagates the sentinels correctly when going backwards in time, but incorrectly when going forwards, for reasons unknown.
Next step is to reproduce it with a federated room and see where the incorrect state sneaks in.
To try to spell out the scenarii i'm guessing at here:
A.com has a room with timeline e1, e2, e3, e4, e5, all sent by Alice, where e1 is her membership event.
user X on B.com joins A.com, and during join B.com gets a copy of the state of the room (i.e. e1). X's join event is e6.
On having joined the room, user X's /sync returns with state of {e1, e6}, and timeline of [e6].
X sends a message in the room: e7
Alice responds with: e8
Meanwhile, X's client should try to fill in the missing history, and calls /messages on B.com which should try to pull in the history from A.com. (It looks like this doesn't happen though, as we saw X has no pagination token, so can't call /messages)
user Y on B.com also joins the room
Theory one:
8. On having joined the room, user Y's /sync returns with state of {e1, e6}, and timeline of [e6, e7, e8] - i.e. only the local events for B.com. For some reason js-sdk gets the sender sentinels right for [e6, e7, e8] in the timeline.
9. Then Alice sends another event, e9, and Y's riot applies the wrong sentinel - perhaps because getting confused between 'live' timeline events, and processing the non-live ones it received in the initial /sync response. <-- this seems most likely
Theory two:
8. On having joined the room, user Y's /sync returns with no state, or perhaps even no timeline, due to synapse bugs, but it does have a pagination token.
9. user Y then calls /messages to try to fill in the gap, and receives the local history [e6, e7, e8] and state for {e1, e6}, and applies the sentinels correctly.
10. A synapse bug means that /messages doesn't return a pagination token from /messages, so we can't paginate back further.
11. Alice sends another event, e9, and Y's riot applies the wrong sentinel, because it failed to correctly set a forwards-looking sentinel because it got confused by the initial /sync contents, or something else.
Activity
ara4n commentedon Sep 13, 2018
@bwindels do you think there's a risk this is a regression introduced by LL stuff?
bwindels commentedon Sep 13, 2018
hard to tell, but that is what it looks like, yeah. Do you remember if there might have been a gappy sync in between?
ara4n commentedon Sep 14, 2018
no gappy sync; this was on joining the room for the first time.
interesting logs from before i lost the browser tab:
and (in terms of #7335), there were no sentinels at all in the room.oldState (aka liveTimeline.startState). There was also no paginationToken at all in oldState, hence #7335.
ara4n commentedon Sep 14, 2018
We tried to repro this earlier but failed, but i think the key missing ingredient is that the room has to start off federated. This means that when the first local user joins, there isn't any DAG available to sync, so their join will have no history at all. When the second local user joins, they may only see the local room history if the remote stuff hasn't arrived yet - and if the second user doesn't even see the local room history, then it might only arrive via /messages, then that might explain why we have correct members in the history loaded by /messages, but not in the ongoing forward-paginating timeline.
ara4n commentedon Sep 19, 2018
Fwiw, this feels like a sentinel bug to me:that riot propagates the sentinels correctly when going backwards in time, but incorrectly when going forwards, for reasons unknown.
Next step is to reproduce it with a federated room and see where the incorrect state sneaks in.
ara4n commentedon Sep 19, 2018
To try to spell out the scenarii i'm guessing at here:
stateof {e1, e6}, andtimelineof [e6].Theory one:
8. On having joined the room, user Y's /sync returns with
stateof {e1, e6}, andtimelineof [e6, e7, e8] - i.e. only the local events for B.com. For some reason js-sdk gets the sender sentinels right for [e6, e7, e8] in the timeline.9. Then Alice sends another event, e9, and Y's riot applies the wrong sentinel - perhaps because getting confused between 'live' timeline events, and processing the non-live ones it received in the initial /sync response. <-- this seems most likely
Theory two:
8. On having joined the room, user Y's /sync returns with no state, or perhaps even no timeline, due to synapse bugs, but it does have a pagination token.
9. user Y then calls /messages to try to fill in the gap, and receives the local history [e6, e7, e8] and state for {e1, e6}, and applies the sentinels correctly.
10. A synapse bug means that /messages doesn't return a pagination token from /messages, so we can't paginate back further.
11. Alice sends another event, e9, and Y's riot applies the wrong sentinel, because it failed to correctly set a forwards-looking sentinel because it got confused by the initial /sync contents, or something else.
jryans commentedon Mar 3, 2020
Related: #6944
Merge tag 'v1.9.8' into build
Merge tag 'v1.9.8' into sc
t3chguy commentedon Nov 14, 2024
Closing this as presumed fixed in the many years due to lack of further reported cases - also LL-off mode is unsupported