Skip to content

Faster room joins: Fix bug in awaitPartialStateJoinCompletion #487

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

Conversation

squahtx
Copy link
Contributor

@squahtx squahtx commented Sep 30, 2022

/sync is not a good way to wait for a room to transition to full
state, since it only waits for the full state at particular events
instead of the whole room. This caused flakiness in the "Device list
updates no longer reach departed servers after partial state join
completes" test.

Use /members instead to wait for partial state joins to complete.


Fixes matrix-org/synapse#13977.
Fixes matrix-org/synapse#14010.

`/sync` is not a good way to wait for a room to transition to full
state, since it only waits for the full state at particular events
instead of the whole room. This caused flakiness in the "Device list
updates no longer reach departed servers after partial state join
completes" test.

Use `/members` instead to wait for partial state joins to complete.
@squahtx squahtx requested review from a team as code owners September 30, 2022 17:29
t,
"GET",
[]string{"_matrix", "client", "v3", "rooms", room.RoomID, "members"},
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should expose a way for clients to know if the room is partial, rather than trying to infer it? It even sounds like something we might want to expose in the UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds possibly useful. Though I wonder how much the concept of a partial state room (as opposed to a partial state event) is specific to the synapse implementation.

I suppose there are at least three reasons awaitPartialStateJoinCompletion might be used:

  • to wait for a particular event to have full state
  • to wait for the "current" state of the room to be a full state
  • to wait for all events in the room to have full state (implies the previous 2)

I'd guess that clients and most tests are primarily interested in the 2nd property and it doesn't matter if there's still a partial state event somewhere back in the dag (which synapse doesn't allow, but a theoretical homeserver implementation might).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment