From f182fd7ee3b3efda3046e981a459a3dc83f75719 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Tue, 3 Jan 2023 09:09:26 +0100 Subject: [PATCH] Hopefully fix backfilling --- federationapi/routing/backfill.go | 2 +- roomserver/internal/perform/perform_backfill.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 {