aboutsummaryrefslogtreecommitdiff
path: root/roomserver/roomserver.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-04-28 11:46:47 +0100
committerGitHub <noreply@github.com>2020-04-28 11:46:47 +0100
commit6d832ae544a6221eb01dc7bad170d3b25a534a1e (patch)
treead0eda5ec31154e83188fec4cbc49252cb85b505 /roomserver/roomserver.go
parent3a858afca2368f588b2681de4f4816f26686f540 (diff)
Implement backfill in the roomserver (#983)
* Initial cut for backfilling The syncserver now asks the roomserver via QueryBackfill (which already existed to *handle* backfill requests) which then makes federation requests via gomatrixserverlib.RequestBackfill. Currently, tests fail on subsequent /messages requests because we don't know which servers are in the room, because we are unable to get state snapshots from a backfilled event because that code doesn't exist yet. * WIP backfill, doesn't work * Make initial backfill pass checks * Persist backfilled events with state snapshots * Remove debug lines * Linting * Review comments
Diffstat (limited to 'roomserver/roomserver.go')
-rw-r--r--roomserver/roomserver.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/roomserver/roomserver.go b/roomserver/roomserver.go
index fa4f2062..ea1c5c4c 100644
--- a/roomserver/roomserver.go
+++ b/roomserver/roomserver.go
@@ -18,6 +18,7 @@ import (
"net/http"
"github.com/matrix-org/dendrite/roomserver/api"
+ "github.com/matrix-org/gomatrixserverlib"
asQuery "github.com/matrix-org/dendrite/appservice/query"
"github.com/matrix-org/dendrite/common/basecomponent"
@@ -33,7 +34,7 @@ import (
// allowing other components running in the same process to hit the query the
// APIs directly instead of having to use HTTP.
func SetupRoomServerComponent(
- base *basecomponent.BaseDendrite,
+ base *basecomponent.BaseDendrite, keyRing gomatrixserverlib.JSONVerifier,
) (api.RoomserverAliasAPI, api.RoomserverInputAPI, api.RoomserverQueryAPI) {
roomserverDB, err := storage.Open(string(base.Cfg.Database.RoomServer))
if err != nil {
@@ -51,6 +52,11 @@ func SetupRoomServerComponent(
queryAPI := query.RoomserverQueryAPI{
DB: roomserverDB,
ImmutableCache: base.ImmutableCache,
+ ServerName: base.Cfg.Matrix.ServerName,
+ FedClient: base.CreateFederationClient(),
+ // TODO: We should have a key server so we don't keep adding components
+ // which talk to the same DB.
+ KeyRing: keyRing,
}
queryAPI.SetupHTTP(http.DefaultServeMux)