diff --git a/federationapi/routing/backfill.go b/federationapi/routing/backfill.go index 8da486dde..272f5e9d8 100644 --- a/federationapi/routing/backfill.go +++ b/federationapi/routing/backfill.go @@ -83,7 +83,7 @@ func Backfill( "": eIDs, }, ServerName: request.Origin(), - VirtualHost: request.Origin(), + VirtualHost: request.Destination(), } if req.Limit, err = strconv.Atoi(limit); err != nil { util.GetLogger(httpReq.Context()).WithError(err).Error("strconv.Atoi failed") diff --git a/roomserver/internal/perform/perform_backfill.go b/roomserver/internal/perform/perform_backfill.go index 069f017a9..aea9fabde 100644 --- a/roomserver/internal/perform/perform_backfill.go +++ b/roomserver/internal/perform/perform_backfill.go @@ -56,6 +56,7 @@ func (r *Backfiller) PerformBackfill( // TODO: we could be more sensible and fetch as many events we already have then request the rest // which is what the syncapi does already. if r.IsLocalServerName(request.ServerName) { + logrus.Debugf("backfilling via federation: %+v", request) return r.backfillViaFederation(ctx, request, response) } // someone else is requesting the backfill, try to service their request. @@ -319,6 +320,7 @@ FederationHit: FedClient: b.fsAPI, RememberAuthEvents: false, Server: srv, + Origin: b.virtualHost, } res, err := c.StateIDsBeforeEvent(ctx, targetEvent) if err != nil {