0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-20 10:43:48 +01:00

/send auth errors are silent (#1149)

* /send auth errors are silent

* Fix test
This commit is contained in:
Kegsay 2020-06-23 10:31:17 +01:00 committed by GitHub
parent a1352cbd9e
commit 02565c37aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -176,9 +176,17 @@ func (t *txnReq) processTransaction() (*gomatrixserverlib.RespSend, error) {
util.GetLogger(t.context).Warnf("Processing %s failed fatally: %s", e.EventID(), err)
return nil, err
} else {
util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).Warn("Failed to process incoming federation event, skipping")
// Auth errors mean the event is 'rejected' which have to be silent to appease sytest
_, rejected := err.(*gomatrixserverlib.NotAllowed)
errMsg := err.Error()
if rejected {
errMsg = ""
}
util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).WithField("rejected", rejected).Warn(
"Failed to process incoming federation event, skipping",
)
results[e.EventID()] = gomatrixserverlib.PDUResult{
Error: err.Error(),
Error: errMsg,
}
}
} else {

View file

@ -44,3 +44,7 @@ Existing members see new members' join events
Can recv device messages over federation
Device messages over federation wake up /sync
Wildcard device messages over federation wake up /sync
# We don't implement soft-failed events yet, but because the /send response is vague,
# this test thinks it's all fine...
Inbound federation accepts a second soft-failed event