aboutsummaryrefslogtreecommitdiff
path: root/federationapi/routing/send.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-09-29 14:07:59 +0100
committerGitHub <noreply@github.com>2020-09-29 14:07:59 +0100
commit43cdba9a69674899a5900aee976ebc7add286914 (patch)
treef201d7dea354c604f290e01817538b456af46f6c /federationapi/routing/send.go
parentb0d5d1cc9f0de61ee0738581db11fd218be65dc4 (diff)
Ignore depth in federation API (#1451)
Diffstat (limited to 'federationapi/routing/send.go')
-rw-r--r--federationapi/routing/send.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go
index 4a30f8d7..f8b8bcd6 100644
--- a/federationapi/routing/send.go
+++ b/federationapi/routing/send.go
@@ -656,7 +656,7 @@ retryAllowedState:
// getMissingEvents returns a nil backwardsExtremity if missing events were fetched and handled, else returns the new backwards extremity which we should
// begin from. Returns an error only if we should terminate the transaction which initiated /get_missing_events
// This function recursively calls txnReq.processEvent with the missing events, which will be processed before this function returns.
-// This means that we may recursively call this function, as we spider back up prev_events to the min depth.
+// This means that we may recursively call this function, as we spider back up prev_events.
// nolint:gocyclo
func (t *txnReq) getMissingEvents(ctx context.Context, e gomatrixserverlib.Event, roomVersion gomatrixserverlib.RoomVersion, isInboundTxn bool) (backwardsExtremity *gomatrixserverlib.Event, err error) {
if !isInboundTxn {
@@ -679,11 +679,6 @@ func (t *txnReq) getMissingEvents(ctx context.Context, e gomatrixserverlib.Event
for i := range res.LatestEvents {
latestEvents[i] = res.LatestEvents[i].EventID
}
- // this server just sent us an event for which we do not know its prev_events - ask that server for those prev_events.
- minDepth := int(res.Depth) - 20
- if minDepth < 0 {
- minDepth = 0
- }
servers := []gomatrixserverlib.ServerName{t.Origin}
serverReq := &api.QueryServerJoinedToRoomRequest{
@@ -700,8 +695,6 @@ func (t *txnReq) getMissingEvents(ctx context.Context, e gomatrixserverlib.Event
var m gomatrixserverlib.RespMissingEvents
if m, err = t.federation.LookupMissingEvents(ctx, server, e.RoomID(), gomatrixserverlib.MissingEvents{
Limit: 20,
- // synapse uses the min depth they've ever seen in that room
- MinDepth: minDepth,
// The latest event IDs that the sender already has. These are skipped when retrieving the previous events of latest_events.
EarliestEvents: latestEvents,
// The event IDs to retrieve the previous events for.