diff --git a/roomserver/internal/query/query_room_hierarchy.go b/roomserver/internal/query/query_room_hierarchy.go index a59c834d6..b05db7429 100644 --- a/roomserver/internal/query/query_room_hierarchy.go +++ b/roomserver/internal/query/query_room_hierarchy.go @@ -52,7 +52,7 @@ func (querier *Queryer) QueryNextRoomHierarchyPage(ctx context.Context, walker r // Depth first -> stack data structure for len(unvisited) > 0 { - if len(discoveredRooms) >= limit { + if len(discoveredRooms) >= limit && limit != -1 { break }