Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make client_reader support some more read only APIs #3555

Merged
merged 9 commits into from
Jul 24, 2018

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Jul 18, 2018

Note that the first commit is large due to have to move the code around, but it should functionally be the same.

The added APIs now supported by client reader are GET:

  • /rooms/(?P<room_id>[^/]*)/joined_members$
  • /rooms/(?P<room_id>[^/]*)/context/(?P<event_id>[^/]*)$
  • /rooms/(?P<room_id>[^/]*)/members$
  • /rooms/(?P<room_id>[^/]*)/state$

This will let us call the read only parts from workers, and so be able
to move some APIs off of master, e.g. the `/state` API.
This is in preparation for moving GET /context/ to a worker
@erikjohnston erikjohnston requested a review from a team July 18, 2018 14:35
@erikjohnston
Copy link
Member Author

(The sytest failed due to #3548)

@matrixbot retest this please

@turt2live
Copy link
Member

Please also add them to workers.rst :)

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.

generally looks like an improvement.

Don't forget to update the workers doc to record that there are new endpoints that can be farmed off.

})


class PaginationHandler(MessageHandler):
Copy link
Member

Choose a reason for hiding this comment

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

I can see myself getting annoyed with trying to navigate this file and find this class. I really wouldn't mind if it ended up in its own file (pagination_handler.py or similar).

Can we also be a bit more specific that it's about paginating messages? MessagePaginationHandler would do.

These are in the same handler due to the fact we need to block clients
paginating during a purge.

This subclasses MessageHandler to get at _check_in_room_or_world_readable
Copy link
Member

Choose a reason for hiding this comment

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

this might be better achieved by moving _check_in_room_or_world_readable to Auth?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you!

I was desperately trying to figure out how on earth I could avoid having to subclass just for that method and I drew a complete blank

super(PaginationHandler, self).__init__(hs)

self.hs = hs
self.store = hs.get_datastore()
Copy link
Member

Choose a reason for hiding this comment

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

these are redundant, though as above, I question the wisdom of the subclassing.

@erikjohnston erikjohnston assigned richvdh and unassigned erikjohnston Jul 20, 2018
@erikjohnston erikjohnston force-pushed the erikj/client_apis_move branch from 3fc837a to 0b0b24c Compare July 23, 2018 12:21
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.

this is hard to review because everything is moving, but lgtm in principle

@richvdh richvdh assigned erikjohnston and unassigned richvdh Jul 24, 2018
@erikjohnston erikjohnston merged commit d436ad3 into develop Jul 24, 2018
@erikjohnston erikjohnston deleted the erikj/client_apis_move branch September 20, 2018 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants