mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-24 07:13:09 -06:00
Consistency
This commit is contained in:
parent
6c2a5b4d76
commit
eb0ce0cbf2
|
|
@ -163,13 +163,13 @@ func (r *Inputer) processRoomEvent(
|
|||
switch input.Kind {
|
||||
case api.KindNew:
|
||||
if err = r.updateLatestEvents(
|
||||
ctx, // context
|
||||
roomInfo, // room info for the room being updated
|
||||
stateAtEvent, // state at event (below)
|
||||
event, // event
|
||||
input.SendAsServer, // send as server
|
||||
input.TransactionID, // transaction ID
|
||||
input.HasState, // rewrites state?
|
||||
ctx, // context
|
||||
roomInfo, // room info for the room being updated
|
||||
stateAtEvent, // state at event (below)
|
||||
event, // event
|
||||
input.SendAsServer, // send as server
|
||||
input.TransactionID, // transaction ID
|
||||
stateAtEvent.Overwrite, // rewrites state?
|
||||
); err != nil {
|
||||
return "", fmt.Errorf("r.updateLatestEvents: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,9 +117,6 @@ type latestEventsUpdater struct {
|
|||
// nolint:gocyclo
|
||||
func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
||||
u.lastEventIDSent = u.updater.LastEventIDSent()
|
||||
if !u.stateAtEvent.Overwrite {
|
||||
u.oldStateNID = u.updater.CurrentStateSnapshotNID()
|
||||
}
|
||||
|
||||
// If we are doing a regular event update then we will get the
|
||||
// previous latest events to use as a part of the calculation. If
|
||||
|
|
@ -128,7 +125,8 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
|||
// then start with an empty set - none of the forward extremities
|
||||
// that we knew about before matter anymore.
|
||||
oldLatest := []types.StateAtEventAndReference{}
|
||||
if !u.stateAtEvent.Overwrite {
|
||||
if !u.rewritesState {
|
||||
u.oldStateNID = u.updater.CurrentStateSnapshotNID()
|
||||
oldLatest = u.updater.LatestEvents()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue