fix: Do not compare timestamps when setting roomstate
We now handle state in the correct order in the sync handler. Using the timestamp lead to false results when we still generated a default timestamp of "now" for events, however even without that state events can have an older timestamp like when accepting an invite on a server with the clock behind by a minute and we should instead rely on the sync handler giving us state in the right order.
This commit is contained in:
parent
6f82e92f2c
commit
582963ab91
|
|
@ -196,15 +196,6 @@ class Room {
|
|||
return;
|
||||
}
|
||||
|
||||
// Do not set old events as state events
|
||||
final prevEvent = getState(state.type, stateKey);
|
||||
if (prevEvent != null &&
|
||||
prevEvent.eventId != state.eventId &&
|
||||
prevEvent.originServerTs.millisecondsSinceEpoch >
|
||||
state.originServerTs.millisecondsSinceEpoch) {
|
||||
return;
|
||||
}
|
||||
|
||||
(states[state.type] ??= {})[stateKey] = state;
|
||||
|
||||
client.onRoomState.add(state);
|
||||
|
|
|
|||
Loading…
Reference in New Issue