mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-01-31 16:14:28 -06:00
Don't check missing state for create events
This commit is contained in:
parent
d93ddb08d1
commit
f226066783
|
@ -149,8 +149,14 @@ func (r *Queryer) QueryMissingAuthPrevEvents(
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, prevEventID := range request.PrevEventIDs {
|
for _, prevEventID := range request.PrevEventIDs {
|
||||||
if state, err := r.DB.StateAtEventIDs(ctx, []string{prevEventID}); err != nil || len(state) == 0 {
|
if eventTypes, err := r.DB.EventTypeNIDs(ctx, []string{prevEventID}); err != nil || len(eventTypes) == 0 {
|
||||||
response.MissingPrevEventIDs = append(response.MissingPrevEventIDs, prevEventID)
|
response.MissingPrevEventIDs = append(response.MissingPrevEventIDs, prevEventID)
|
||||||
|
} else if eventTypes[prevEventID] != types.MRoomCreateNID {
|
||||||
|
// We only want to check for missing state for events that aren't create
|
||||||
|
// events, because there is no state before a create event
|
||||||
|
if state, err := r.DB.StateAtEventIDs(ctx, []string{prevEventID}); err != nil || len(state) == 0 {
|
||||||
|
response.MissingPrevEventIDs = append(response.MissingPrevEventIDs, prevEventID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue