mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-10 15:43:09 -06:00
Merge branch 's7evink/complement' of github.com:matrix-org/dendrite into s7evink/complement
This commit is contained in:
commit
76748ae5ea
|
|
@ -301,7 +301,7 @@ func (r *Inputer) processRoomEvent(
|
|||
// bother doing this if the event was already rejected as it just ends up
|
||||
// burning CPU time.
|
||||
historyVisibility := gomatrixserverlib.HistoryVisibilityShared // Default to shared.
|
||||
if input.Kind != api.KindOutlier && rejectionErr == nil && !isRejected && !softfail {
|
||||
if input.Kind != api.KindOutlier && rejectionErr == nil && !isRejected {
|
||||
var err error
|
||||
historyVisibility, rejectionErr, err = r.processStateBefore(ctx, input, missingPrev)
|
||||
if err != nil {
|
||||
|
|
@ -313,7 +313,7 @@ func (r *Inputer) processRoomEvent(
|
|||
}
|
||||
|
||||
// Store the event.
|
||||
_, _, stateAtEvent, redactionEvent, redactedEventID, err := r.DB.StoreEvent(ctx, event, authEventNIDs, isRejected || softfail)
|
||||
_, _, stateAtEvent, redactionEvent, redactedEventID, err := r.DB.StoreEvent(ctx, event, authEventNIDs, isRejected)
|
||||
if err != nil {
|
||||
return fmt.Errorf("updater.StoreEvent: %w", err)
|
||||
}
|
||||
|
|
@ -353,14 +353,18 @@ func (r *Inputer) processRoomEvent(
|
|||
}
|
||||
}
|
||||
|
||||
// We stop here if the event is rejected: We've stored it but won't update forward extremities or notify anyone about it.
|
||||
if isRejected || softfail {
|
||||
logger.WithError(rejectionErr).WithFields(logrus.Fields{
|
||||
"room_id": event.RoomID(),
|
||||
"event_id": event.EventID(),
|
||||
"soft_fail": softfail,
|
||||
"missing_prev": missingPrev,
|
||||
}).Warn("Stored rejected event")
|
||||
// We stop here if the event is rejected: We've stored it but won't update
|
||||
// forward extremities or notify downstream components about it.
|
||||
switch {
|
||||
case isRejected:
|
||||
logger.WithError(rejectionErr).Warn("Stored rejected event")
|
||||
if rejectionErr != nil {
|
||||
return types.RejectedError(rejectionErr.Error())
|
||||
}
|
||||
return nil
|
||||
|
||||
case softfail:
|
||||
logger.WithError(rejectionErr).Warn("Stored soft-failed event")
|
||||
if rejectionErr != nil {
|
||||
return types.RejectedError(rejectionErr.Error())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue