fix: properly overwrite loaded state for partial loaded rooms

Otherwise invites, which get converted to normal rooms, might still have
old member events set in memory, that don't match the current state.
This commit is contained in:
Nicolas Werner 2024-03-04 17:52:06 +01:00
parent 5ffa99d994
commit 6f82e92f2c
No known key found for this signature in database
GPG Key ID: B38119FF80087618
1 changed files with 4 additions and 0 deletions

View File

@ -2463,6 +2463,10 @@ class Client extends MatrixApi {
final importantOrRoomLoaded =
eventUpdate.type == EventUpdateType.inviteState ||
!room.partial ||
// make sure we do overwrite events we have already loaded.
room.states[stateEvent.type]
?.containsKey(stateEvent.stateKey ?? '') ==
true ||
importantStateEvents.contains(stateEvent.type);
if ((noMessageOrNoEdit || editingLastEvent || consecutiveEdit) &&
importantOrRoomLoaded) {