mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-25 15:53:09 -06:00
Try to get missing auth events badly
This commit is contained in:
parent
bd7de2aed7
commit
fe60adfc9e
|
|
@ -367,13 +367,31 @@ func (t *txnReq) processEvent(ctx context.Context, e gomatrixserverlib.Event, is
|
||||||
return roomNotFoundError{e.RoomID()}
|
return roomNotFoundError{e.RoomID()}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(stateResp.MissingPrevEventIDs) > 0 {
|
// TODO: Make this less bad
|
||||||
return t.processEventWithMissingState(ctx, e, stateResp.RoomVersion, isInboundTxn)
|
for _, missingAuthEventID := range stateResp.MissingAuthEventIDs {
|
||||||
|
if tx, err := t.federation.GetEvent(ctx, e.Origin(), missingAuthEventID); err == nil {
|
||||||
|
ev, err := gomatrixserverlib.NewEventFromUntrustedJSON(tx.PDUs[0], stateResp.RoomVersion)
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithError(err).Warnf("Failed to unmarshal auth event %d", missingAuthEventID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
err = api.SendEvents(
|
||||||
|
context.Background(),
|
||||||
|
t.rsAPI,
|
||||||
|
[]gomatrixserverlib.HeaderedEvent{
|
||||||
|
ev.Headered(stateResp.RoomVersion),
|
||||||
|
},
|
||||||
|
api.DoNotSendToOtherServers,
|
||||||
|
nil,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithError(err).Warnf("Failed to submit auth event %d to roomserver", missingAuthEventID)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(stateResp.MissingAuthEventIDs) > 0 {
|
if len(stateResp.MissingPrevEventIDs) > 0 {
|
||||||
// TODO
|
return t.processEventWithMissingState(ctx, e, stateResp.RoomVersion, isInboundTxn)
|
||||||
logrus.Infof("*** %d MISSING AUTH EVENTS for %q ***", len(stateResp.MissingAuthEventIDs), e.EventID())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// pass the event to the roomserver which will do auth checks
|
// pass the event to the roomserver which will do auth checks
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue