Don't flake so badly for rejected events
This commit is contained in:
parent
908d881a6e
commit
2a2f84052e
|
@ -297,7 +297,7 @@ func (r *Inputer) processRoomEvent(
|
|||
"soft_fail": softfail,
|
||||
"missing_prev": missingPrev,
|
||||
}).Warn("Stored rejected event")
|
||||
return commitTransaction, rejectionErr
|
||||
return commitTransaction, types.RejectedError(rejectionErr.Error())
|
||||
}
|
||||
|
||||
switch input.Kind {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/roomserver/internal/query"
|
||||
"github.com/matrix-org/dendrite/roomserver/storage/shared"
|
||||
"github.com/matrix-org/dendrite/roomserver/types"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -205,7 +206,9 @@ func (t *missingStateReq) processEventWithMissingState(
|
|||
SendAsServer: api.DoNotSendToOtherServers,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("t.inputer.processRoomEvent: %w", err)
|
||||
if _, ok := err.(types.RejectedError); !ok {
|
||||
return fmt.Errorf("t.inputer.processRoomEvent: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Then send all of the newer backfilled events, of which will all be newer
|
||||
|
@ -220,7 +223,9 @@ func (t *missingStateReq) processEventWithMissingState(
|
|||
SendAsServer: api.DoNotSendToOtherServers,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("t.inputer.processRoomEvent: %w", err)
|
||||
if _, ok := err.(types.RejectedError); !ok {
|
||||
return fmt.Errorf("t.inputer.processRoomEvent: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -209,6 +209,12 @@ type MissingEventError string
|
|||
|
||||
func (e MissingEventError) Error() string { return string(e) }
|
||||
|
||||
// A RejectedError is returned when an event is stored as rejected. The error
|
||||
// contains the reason why.
|
||||
type RejectedError string
|
||||
|
||||
func (e RejectedError) Error() string { return string(e) }
|
||||
|
||||
// RoomInfo contains metadata about a room
|
||||
type RoomInfo struct {
|
||||
RoomNID RoomNID
|
||||
|
|
Loading…
Reference in a new issue