Store rejected remote invite events as outliers

Currently they're stored as non-outliers even though the server isn't in
the room, which can be problematic in places where the code assumes it
has the state for all non outlier events.

In particular, there is an edge case where persisting the leave event
triggers a state resolution, which requires looking up the room version
from state. Since the server doesn't have the state, this causes an
exception to be thrown.
This commit is contained in:
Erik Johnston 2019-01-16 15:13:07 +00:00
parent 6b90ae6efc
commit 886e5acc76
3 changed files with 21 additions and 38 deletions

View file

@ -591,10 +591,7 @@ class RoomMemberStore(RoomMemberWorkerStore):
# i.e., its something that has just happened.
# The only current event that can also be an outlier is if its an
# invite that has come in across federation.
is_new_state = not backfilled and (
not event.internal_metadata.is_outlier()
or event.internal_metadata.is_invite_from_remote()
)
is_new_state = not backfilled
is_mine = self.hs.is_mine_id(event.state_key)
if is_new_state and is_mine:
if event.membership == Membership.INVITE: