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

Proposal to improve /members and /joined_rooms #1337

Merged
merged 1 commit into from
Dec 7, 2020

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Dec 4, 2020

Rendered
Author: @turt2live
this was converted from an issue to a PR using github's tooling, which apparently changes the author

Related: https://github.com/matrix-org/matrix-doc/issues/1123

@KitsuneRal
Copy link
Member

As a client author, I very much welcome this. However, I need /members to get one more parameter, a sync batch token so that the list of members could somehow be related to what is received over /sync. Without that I have to stop the sync loop while I'm requesting /members to avoid a race condition.

@turt2live
Copy link
Member Author

Including sync tokens is out of scope for this proposal. I'm pretty sure you could use the context API to do what you're looking for anyways.

@t3chguy
Copy link
Member

t3chguy commented Jun 30, 2018

or the /messages API with a Filter for m.room.member

@turt2live turt2live added proposal-ready-for-review proposal A matrix spec change proposal labels Jul 10, 2018
@richvdh
Copy link
Member

richvdh commented Jul 31, 2018

A +1 from me for Option 1 here. Options 2 and 3 feel somewhat overblown.

@turt2live turt2live added this to To do: proposals (prioritized) in August 2018 r0 Aug 14, 2018
@turt2live turt2live moved this from To do: proposals (not overly prioritized) to To do: client-server (prioritized) in August 2018 r0 Aug 20, 2018
@turt2live turt2live removed this from To do: client-server (prioritized) in August 2018 r0 Aug 30, 2018
@turt2live turt2live added the client-server Client-Server API label Sep 6, 2018
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Dec 11, 2018
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Dec 11, 2018
Signed-off-by: Alexey Rusakov <Alexey.Rusakov@pm.me>
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Dec 12, 2018
@richvdh
Copy link
Member

richvdh commented Dec 18, 2018

Am I right in understanding that this proposal has not yet been implemented in a matrix server? (Indeed, no agreement has yet been reached on what to do.) I am surprised at @KitsuneRal 's assertion that he has implemented client-side features which rely on it...

@turt2live
Copy link
Member Author

This proposal hasn't been implemented anywhere, although part of lazy loading overlaps with this proposal. I have to figure out what exactly needs to change here to accommodate the lazy laoding changes still.

@KitsuneRal
Copy link
Member

Uhm, well, then that probably means me sending at= to the server completely in vain.

@erikjohnston
Copy link
Member

Synapse does implement at= as part of lazy loading: https://github.com/matrix-org/synapse/blob/master/synapse/rest/client/v1/room.py#L396

@erikjohnston
Copy link
Member

erikjohnston commented Dec 24, 2018

This proposal doesn't address the primary reason for /joined_members: to simply return the list of joined users without the member event; which significantly reduces load on the server. Given that, there are two options: 1) keep /joined_members or 2) add a query param to /members to be able to change the response format.

Personally, I'm in favour of keeping /joined_members for two reasons. Firstly, it feels like /members is starting to become a bit of a kitchen sink in terms of the number of options. Adding yet another option to change the response format feels sad, especially if we don't support changing response format anywhere else.

Secondly, and more importantly, the /joined_members API is designed to be "fast", and client/bridge implementers are relying on them being at least sufficiently fast that calling them won't get rate limited. This then means that that code path has to be sufficiently fast across all server implementations that they don't get rate limited, otherwise we'll end up in a world where some clients/bridges only really work with some server implementations.

In practice, its unlikely that a naive implementation of /members will be particularly fast, as its easy enough to implement all the options as post processing. This broadly means that we'll probably have to spec (or add a note to the spec) that that code path should be "fast", and I really think its easier to spec and feels more natural when its a separate API in the spec.

Having said all that I don't have an objection to adding enough knobs to /members to make it functionally basically equivalent to /joined_members (though perhaps without changing the event format). We can always add a quick note to the spec to indicate that /joined_members is basically just an optimised fast path.

TL;DR: I think APIs that are designed to be called a lot and need to be "fast" should be separate APIs (with a note in the spec to indicate that fact)


Separately, if we're doing filtering I'd prefer we be consistent and use the filter param, at which point I don't really see why we'd not just use /state with an appropriate filter. So broadly, I'm sort of happy with adding membership query param onto /member if they then basically become helper APIs for a doing a full /state with an appropriate filter.

Similarly, I like having /rooms if it basically has the same format as /sync so it becomes effectively a helper API for an initial /sync. Though for consistency then /rooms should probably then not include rooms you've left unless an include_leave query param has been specified.

@turt2live turt2live added T-Core and removed T-Core labels Dec 24, 2018
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Dec 26, 2018
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Jan 5, 2019
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Feb 11, 2019
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Feb 12, 2019
KitsuneRal added a commit to quotient-im/matrix-doc that referenced this pull request Mar 23, 2019
@turt2live turt2live self-assigned this Mar 28, 2019
@turt2live turt2live added the kind:maintenance MSC which clarifies/updates existing spec label Apr 21, 2020
@turt2live turt2live merged commit 0961c7b into master Dec 7, 2020
@turt2live
Copy link
Member Author

gah, merging branches is hard - reverted in 6ccc548

@turt2live turt2live removed kind:maintenance MSC which clarifies/updates existing spec proposal A matrix spec change proposal proposal-in-review labels Dec 7, 2020
@turt2live
Copy link
Member Author

Github won't let you reopen PRs, so #2895 exists now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants