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:
Kegsay 2020-05-19 18:42:55 +01:00 committed by GitHub
parent 5faecdac82
commit 260e69d138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 2 deletions

View file

@ -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