Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not echo/send events created by appservice back out to appservice #14776

Open
matrixbot opened this issue Dec 20, 2023 · 0 comments
Open

Do not echo/send events created by appservice back out to appservice #14776

matrixbot opened this issue Dec 20, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 20, 2023

This issue has been migrated from #14776.


Spawning from the PoC in matrix-org/synapse#14729

Problem

Currently, when an application service (appservice) creates an event, if the appservice is also "interested", we also send that event back out to the appservice (echo). This echo is normally ignored by bridge libraries like with the suppressEcho option in matrix-appservice-bridge. But there is significant overhead when it comes to ignoring all of those transactions on the client and even Synapse itself can get backed up with events it doesn't even necessarily need to send out. Instead of having the round-trip just to ignore, we can ignore directly in Synapse to not send it out via the appservice.

We were seeing this problem in real-life with the Gitter -> Matrix import process and made a quick patch to get around this problem. @turt2live also shared a similar t2bot.io patch that they've been running for a long-time: t2bot/synapse@3c1cd9a

Potential solution

There should be a way to ignore events that are created by an appservice to not go back out the appservice that sent it. Or ideally, this behavior should be a sane default. This probably requires a MSC to define the behavior in the AS registration config.

@Half-Shot shared MSC2487 which is related but goes beyond the scope that I care about and given the extra complexity, extra bikeshedding will ensue. Probably best to create a new MSC.

Potential alternatives

One alternative in the Gitter -> Matrix import scenario is to have something like matrix-org/synapse#3237 which ignores any old events which would work 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. But we should also handle the case for new/any events which this issue addresses.

@matrixbot matrixbot changed the title Dummy issue Do not echo/send events created by appservice back out to appservice Dec 21, 2023
@matrixbot matrixbot reopened this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant