mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Introduce a new stream for the appservice consumer (#3277)
This introduces a new stream the syncAPI produces to once it processed a `OutputRoomEvent` and the appservices consumes. This is to work around a race condition where appservices receive an event before the syncAPI has handled it, this can result in e.g. calls to `/joined_members` returning a wrong membership list.
This commit is contained in:
parent
185ad6b00d
commit
1555b3542d
6 changed files with 264 additions and 2 deletions
|
@ -100,9 +100,16 @@ func AddPublicRoutes(
|
|||
logrus.WithError(err).Panicf("failed to start key change consumer")
|
||||
}
|
||||
|
||||
var asProducer *producers.AppserviceEventProducer
|
||||
if len(dendriteCfg.AppServiceAPI.Derived.ApplicationServices) > 0 {
|
||||
asProducer = &producers.AppserviceEventProducer{
|
||||
JetStream: js, Topic: dendriteCfg.Global.JetStream.Prefixed(jetstream.OutputAppserviceEvent),
|
||||
}
|
||||
}
|
||||
|
||||
roomConsumer := consumers.NewOutputRoomEventConsumer(
|
||||
processContext, &dendriteCfg.SyncAPI, js, syncDB, notifier, streams.PDUStreamProvider,
|
||||
streams.InviteStreamProvider, rsAPI, fts,
|
||||
streams.InviteStreamProvider, rsAPI, fts, asProducer,
|
||||
)
|
||||
if err = roomConsumer.Start(); err != nil {
|
||||
logrus.WithError(err).Panicf("failed to start room server consumer")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue