Skip to content

example 1 for gedisa missing messages #51

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jason-famedly
Copy link

@jason-famedly jason-famedly commented Jul 1, 2025

One of two potential options. Unfinished:

  • need to adjust the get_missing_events response to be smarter
  • decide if keeping the Linearizer I included

This will send additional forward extremities that are in existence during a remote room join to the remote server requesting the join but not to other servers that may already be in the room.

The order of events:

  1. Simultaneous:
    A. make_join from remote server
    B. a message sent from local server
    C. make_join response from local server that does not include the message as a prev_event
  2. send_join from remote server, response from local server
    A. partial state join begins
  3. remote server receives the message as a forward extremity via it's /send endpoint, saves it in a queue until the partial state join begins syncing additional room state
  4. remote server begins syncing additional room state, sees the item in the queue and begins processing that.
    A. remote server places a backfill request(which starts at the invite event, because of how backfill points are calculated)
    B. remote server places a get_missing_events request, trying to retrieve events between the join event and the message event(spoiler: there are none).
    1. request is made with latest_events being the message event and earliest_events being the join, because that is how the stream orderings look on the remote server. The SQL for answering a get_missing_events request just does a walk through event_edges based on prev_events, and returns up to the limit requested. The added wrinkle that the spec says that /get_missing_events is only supposed to return prev_events related to(in this case) the message event means that making /get_missing_events smarter is rather difficult.

The backfill and the get_missing_events are technically a race, in that both are essentially retrieving the same data twice. The default limit placed for /get_missing_events is 10. So it may be likely that this is not a large problem, although it is technically doubling the work. Since they are both making events de-outliered, neither can see that they are doing double duty. So:

I applied a Linearizer to try and mitigate this, I don't recall if it worked or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant