Tweaks to latest events updater (#1045)

* Comment out updaters a bit, add overwrite flag to latest events

* Make sure we don't send fast-forwarded state changes over federation, start with empty set when overwriting

* Remove redundant check for overwrite
This commit is contained in:
Neil Alexander 2020-05-18 17:49:24 +01:00 committed by GitHub
parent 5c221f0655
commit 9ef30bb13b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 23 deletions

View file

@ -16,7 +16,6 @@ package internal
import (
"context"
"errors"
"fmt"
"github.com/matrix-org/dendrite/roomserver/api"
@ -108,10 +107,10 @@ func updateMembership(
}
if add == nil {
// This shouldn't happen. Returning an error here is better than panicking
// in the membership updater functions later on.
// TODO: Why does this happen to begin with?
return updates, errors.New("add should not be nil")
// This can happen when we have rejoined a room and suddenly we have a
// divergence between the former state and the new one. We don't want to
// act on removals and apparently there are no adds, so stop here.
return updates, nil
}
mu, err := updater.MembershipUpdater(targetUserNID)