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