Use HasState more opportunistically

This commit is contained in:
Neil Alexander 2022-02-08 17:39:23 +00:00
parent 8afdb167f6
commit 6abd2df1f1
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -299,7 +299,7 @@ func (r *Inputer) processRoomEvent(
return rollbackTransaction, fmt.Errorf("updater.RoomInfo missing for room %s", event.RoomID())
}
if !missingPrev && stateAtEvent.BeforeStateSnapshotNID == 0 {
if input.HasState || (!missingPrev && stateAtEvent.BeforeStateSnapshotNID == 0) {
// We haven't calculated a state for this event yet.
// Lets calculate one.
err = r.calculateAndSetState(ctx, updater, input, roomInfo, &stateAtEvent, event, isRejected)