mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-09 15:13:12 -06:00
Try again
This commit is contained in:
parent
13ce67ecfe
commit
ef4aa59fef
|
|
@ -233,7 +233,7 @@ func (r *Inputer) processRoomEvent(
|
|||
var err error
|
||||
softfail, err = helpers.CheckForSoftFail(ctx, roomInfo, r.DB, headered, input.StateEventIDs)
|
||||
if err != nil {
|
||||
logger.WithError(err).Warnf("Event %s rejected by current room state", event.EventID())
|
||||
logger.WithError(err).Warnf("Event %s rejected by current room state (roominfo %+v)", event.EventID(), roomInfo)
|
||||
rejectionErr = fmt.Errorf("rejected by current room state: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
@ -337,10 +337,12 @@ func (r *Inputer) processRoomEvent(
|
|||
|
||||
// Request the room info again — it's possible that the room has been
|
||||
// created by now if it didn't exist already.
|
||||
logrus.Printf("Room info before: %+v", roomInfo)
|
||||
roomInfo, err = r.DB.RoomInfo(ctx, event.RoomID())
|
||||
if err != nil {
|
||||
return fmt.Errorf("updater.RoomInfo: %w", err)
|
||||
}
|
||||
logrus.Printf("Room info after: %+v", roomInfo)
|
||||
if roomInfo == nil {
|
||||
return fmt.Errorf("updater.RoomInfo missing for room %s", event.RoomID())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,15 @@ func (r *Inputer) updateLatestEvents(
|
|||
return fmt.Errorf("u.doUpdateLatestEvents: %w", err)
|
||||
}
|
||||
|
||||
// Since it's entirely possible that this types.RoomInfo came from the
|
||||
// cache, we should make sure to update that entry so that the next run
|
||||
// works from live data.
|
||||
defer func() {
|
||||
if succeeded {
|
||||
u.roomInfo.Update(u.newStateNID, len(u.latest) == 0)
|
||||
}
|
||||
}()
|
||||
|
||||
succeeded = true
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,11 +229,6 @@ func (u *RoomUpdater) SetLatestEvents(
|
|||
if err := u.d.RoomsTable.UpdateLatestEventNIDs(u.ctx, txn, roomNID, eventNIDs, lastEventNIDSent, currentStateSnapshotNID); err != nil {
|
||||
return fmt.Errorf("u.d.RoomsTable.updateLatestEventNIDs: %w", err)
|
||||
}
|
||||
|
||||
// Since it's entirely possible that this types.RoomInfo came from the
|
||||
// cache, we should make sure to update that entry so that the next run
|
||||
// works from live data.
|
||||
u.roomInfo.Update(currentStateSnapshotNID, len(eventNIDs) == 0)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue