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

Events sent immediately after joining can be incorrectly soft-failed #10066

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

Events sent immediately after joining can be incorrectly soft-failed #10066

matrixbot opened this issue Dec 18, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 18, 2023

This issue has been migrated from #10066.


Description

The Gitter bridge seems to have reproduced a race condition in federation where because the appservice joins and sends a message in quick succession, the message can out run the join which causes the message to soft_fail.

To see an actual reproduction, there is a missing message in the !SrkiFczPSWmYrlSNYF:matrix.org room for matrix.org homeserver users ($mMJdjGPC2GaoWK3pLApa_O2vBoeuQwYtP6iY6XzbrfY). This is tracked on Gitter by https://gitlab.com/gitterHQ/webapp/-/issues/2770#note_583925093

The event exists in the gitter.im homeserver database and is visible to the gitter.im homeserver where the Gitter bridge appservice operates. The message is also visible to any new homeserver that comes in the room and backfills the messages. It's only not visible on the matrix.org homeserver.

The message also exists on the matrix.org homeserver database but is soft_failed (thanks to @richvdh for checking the database)

@Half-Shot has also seen this happen a few times with the IRC bridge.

As @leonerd from matrix-org/synapse#1444 and @Half-Shot mentioned, this is probably not a problem for normal users because the time taken to join and then send a message is some number of seconds. Whereas with appservices, can join and send an event in quick succession (almost instantly).

Related issues:

Steps to reproduce

  1. Create a room on HS1, !my-room:hs1
  2. Setup HS2 with an appservice
  3. Join and send a message through the appservice to !my-room:hs1
    • The appservice is probably not necessary to reproduce. Just send a join and message event from HS2
  4. Check whether the message is visible on hs1
  5. Since it's a race condition, this probably does not always reproduce

Version information

  • Homeserver: gitter.im -> matrix.org
@matrixbot matrixbot changed the title Dummy issue Events sent immediately after joining can be incorrectly soft-failed 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