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

New /publicRoom APIs #388

Merged
merged 20 commits into from
Nov 21, 2016
Merged

New /publicRoom APIs #388

merged 20 commits into from
Nov 21, 2016

Conversation

erikjohnston
Copy link
Member

No description provided.

@erikjohnston erikjohnston changed the title Erikj/public rooms New /publicRoom APIs Sep 29, 2016
@erikjohnston
Copy link
Member Author

@dbkr Can you just sanity check that it matches your understanding?

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

Some nit-pickery. I realise that partly I'm requesting changes to existing stuff, but (a) it's a good opportunity to fix it, and (b) you're c&ping the broken stuff and I'd prefer not to see it spread.

A bunch of the comments apply to the POST version as well as the GET version.

canonical_alias:
type: string
description: |-
The canonical alias of the room, if any. May be null.
Copy link
Member

@richvdh richvdh Sep 29, 2016

Choose a reason for hiding this comment

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

Null, but not absent? I thought we avoided nulls in the API. If it really can be null rather than absent, it needs adding to required and to the example.

Ditto name, topic, etc, and ditto in the POST API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to be optional rather than null.

type: string
description: |-
The name of the room, if any. May be null.
num_joined_members:
Copy link
Member

Choose a reason for hiding this comment

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

is this required? Needs adding to required if so; otherwise could do with explictly saying it's optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

type: string
description: |-
A pagination token for the response, if there are any more results.
total_room_count_estimate:
Copy link
Member

Choose a reason for hiding this comment

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

required? optional?

400:
description: >
The request body is malformed or the room alias specified is already taken.
post:
Copy link
Member

Choose a reason for hiding this comment

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

feels like POST /_matrix/client/unstable/publicRooms should be for adding rooms to the list. I don't really have any better suggestions though :/.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed :/

type: string
description: |-
A pagination token for the response, if there are any more results.
prev_batch:
Copy link
Member

@richvdh richvdh Sep 29, 2016

Choose a reason for hiding this comment

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

what's this for? next_batch I get, but not prev_batch. It sounds like there might be requirements on the server which aren't being made explicit here?

description: |-
Optional filtering of the returned rooms.
properties:
generic_search_term:
Copy link
Member

Choose a reason for hiding this comment

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

required? optional?

Copy link
Member Author

Choose a reason for hiding this comment

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

I appended (Optional) to the description, since I can't explicitly say required: [] at the top level :/

next_batch:
type: string
description: |-
A pagination token for the response, if there are any more results.
Copy link
Member

Choose a reason for hiding this comment

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

let's be more explicit here: a client determines that they have reached the end of the list by the absence of next_batch ?

@richvdh
Copy link
Member

richvdh commented Sep 29, 2016

Also: needs a changelog entry, please.

@erikjohnston
Copy link
Member Author

@richvdh PTAL

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

sorry, still fonxing this on the null fields situation

A pagination token for the response.
A pagination token that allows fetching previous results. The
absence of this token means there are no results before this
batch, i.e. this is the first batch.
Copy link
Member

Choose a reason for hiding this comment

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

Ah; is the direction of pagination implied in the token, unlike other APIs where there is an explicit direction flag? might be worth emphasising that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated to mention this.

@@ -35,6 +35,8 @@
- Add top-level ``account_data`` key to the responses to ``GET /sync`` and
``GET /initialSync``
(`#380 <https://github.com/matrix-org/matrix-doc/pull/380>`_).
- Add pagination and filter support to ``/publicRooms``
Copy link
Member

Choose a reason for hiding this comment

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

... and more details in the response?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added more details

@richvdh richvdh assigned erikjohnston and unassigned richvdh Sep 30, 2016
@erikjohnston erikjohnston assigned richvdh and unassigned erikjohnston Sep 30, 2016
name: since
type: string
description: |-
A pagination token from a previous request, allowing clients to
Copy link
Member

Choose a reason for hiding this comment

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

Maybe worth clarifying that this can be either a prev or next token?

Copy link
Member

Choose a reason for hiding this comment

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

(done)

type: string
description: |-
A pagination token from a previous request, allowing clients to
get the next batch of rooms.
Copy link
Member

Choose a reason for hiding this comment

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

or previous

Copy link
Member

Choose a reason for hiding this comment

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

or previous

@dbkr dbkr removed their assignment Oct 3, 2016
}
400:
description: >
The request body is malformed or the room alias specified is already taken.
Copy link
Member

@richvdh richvdh Oct 3, 2016

Choose a reason for hiding this comment

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

This doesn't sound right. There is no request body for a GET, and there is no specified room alias.

Similarly on the POST endpoint.

Copy link
Member

Choose a reason for hiding this comment

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

(done)

400:
description: >
The request body is malformed or the room alias specified is already taken.
post:
Copy link
Member

Choose a reason for hiding this comment

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

GET endpoint is missing tags

A pagination token that allows fetching previous results. The
absence of this token means there are no results before this
batch, i.e. this is the first batch.
The direction of pagination is specified solely by which token
Copy link
Member

Choose a reason for hiding this comment

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

I think this would make more sense on the since parameter than here.

Copy link
Member

Choose a reason for hiding this comment

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

(done)

Copy link
Member

Choose a reason for hiding this comment

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

Not done. Needs doing on the POST endpoint too.

type: object
title: "Filter"
description: |-
Optional filtering of the returned rooms.
Copy link
Member

Choose a reason for hiding this comment

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

I think "Filter to apply to the results" reads better. No need to emphasise that it is optional (particularly since you don't for since and limit).

@richvdh richvdh assigned erikjohnston and unassigned richvdh Oct 3, 2016
@erikjohnston erikjohnston removed their assignment Oct 11, 2016
type: number
description: |-
Limit the number of results returned, ordered by number of
memebers in the room. Defaults to no limit.
Copy link
Member

Choose a reason for hiding this comment

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

"memebers"

type: string
description: |-
A pagination token from a previous request, allowing clients to
get the next batch of rooms.
Copy link
Member

Choose a reason for hiding this comment

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

or previous

type: number
description: |-
Limit the number of results returned, ordered by number of
memebers in the room. Defaults to no limit.
Copy link
Member

Choose a reason for hiding this comment

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

"memebers"

name: limit
type: number
description: |-
Limit the number of results returned, ordered by number of
Copy link
Member

@richvdh richvdh Oct 11, 2016

Choose a reason for hiding this comment

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

Do we return the busiest or least busy rooms? I'm assuming the former, but be explicit please.

Joined members? Invited members? Banned/left members?

Are the results returned ordered by number of members, or does this just apply to the limit? If the former, this should go elsewhere. If the latter, you probably want something like "Limit for the number of results returned. If there are more results, the rooms with the {most|fewest} members will be returned. By default, there is no limit." (You probably want that anyway).

Ditto for the POST API.

@richvdh richvdh assigned erikjohnston and unassigned richvdh Oct 11, 2016
@erikjohnston erikjohnston assigned richvdh and unassigned erikjohnston Nov 21, 2016
 * order by *joined* members
 * clarify pagination direction behaviour
@richvdh richvdh merged commit 02a8715 into master Nov 21, 2016
@afranke afranke deleted the erikj/public_rooms branch September 22, 2021 10:26
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.

3 participants