This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Draft: Ignore sending events to appservice when they come from our own homeserver #14729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ignore sending events to appservice when they come from our own homeserver
This is a rough patch for the Gitter homeserver so we can better cope with the massive import load. Since we're the ones who imported the messages and the only ones who send messages on the homeserver, we can safely ignore any events that come from us since we already know about the events on the Gitter side.
Currently, we import a bunch of messages Gitter -> Synapse and Synapse sends them back to us via the appservice where they are ignored on the Gitter bridge side via the
suppressEcho
option inmatrix-appservice-bridge
. But just the overhead of ignoring all of the transactions isn't fast enough to keep up. Instead of having the round-trip just to ignore, we can ignore directly in Synapse to not send to us via the appservice.This logic only really applies to the Gitter situation but if we can write a more general patch in the future, it would be good to ignore events that come in through the appservice to not go back out the appservice that sent it. This probably requires a MSC to define the behavior in the AS registration config.
An alternative, is to something like #3237 which ignores any old events which for the Gitter import would be perfectly fine since we're only importing old messages. And on the Gitter side of the bridge, we already ignore any events older than 30 minutes anyway so a solution to that separate issue makes sense in any case.
Context:
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)