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

@ -535,9 +535,14 @@ func (r *RoomserverInternalAPI) backfillViaFederation(ctx context.Context, req *
return fmt.Errorf("backfillViaFederation: unknown room version for room %s : %w", req.RoomID, err)
}
requester := newBackfillRequester(r.DB, r.FedClient, r.ServerName)
// Request 100 items regardless of what the query asks for.
// We don't want to go much higher than this.
// We can't honour exactly the limit as some sytests rely on requesting more for tests to pass
// (so we don't need to hit /state_ids which the test has no listener for)
// Specifically the test "Outbound federation can backfill events"
events, err := gomatrixserverlib.RequestBackfill(
ctx, requester,
r.KeyRing, req.RoomID, roomVer, req.EarliestEventsIDs, req.Limit)
r.KeyRing, req.RoomID, roomVer, req.EarliestEventsIDs, 100)
if err != nil {
return err
}