mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 13:52:46 +00:00
Make "Outbound federation can backfill events" pass sytest (#1049)
- Use a backfill limit of 100 regardless of what was asked. - Special case the create event for `StateIDsBeforeEvent` - Trim to the limit in `syncapi`
This commit is contained in:
parent
5faecdac82
commit
260e69d138
4 changed files with 21 additions and 2 deletions
|
@ -412,7 +412,14 @@ func (r *messagesReq) backfill(roomID string, fromEventIDs []string, limit int)
|
|||
}
|
||||
}
|
||||
|
||||
return res.Events, nil
|
||||
// we may have got more than the requested limit so resize now
|
||||
events := res.Events
|
||||
if len(events) > limit {
|
||||
// last `limit` events
|
||||
events = events[len(events)-limit:]
|
||||
}
|
||||
|
||||
return events, nil
|
||||
}
|
||||
|
||||
// setToDefault returns the default value for the "to" query parameter of a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue