-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Make client_reader support some more read only APIs #3555
Conversation
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
(The sytest failed due to #3548) @matrixbot retest this please |
Please also add them to workers.rst :) |
There was a problem hiding this 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.
synapse/handlers/message.py
Outdated
}) | ||
|
||
|
||
class PaginationHandler(MessageHandler): |
There was a problem hiding this comment.
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.
synapse/handlers/message.py
Outdated
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
synapse/handlers/message.py
Outdated
super(PaginationHandler, self).__init__(hs) | ||
|
||
self.hs = hs | ||
self.store = hs.get_datastore() |
There was a problem hiding this comment.
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.
3fc837a
to
0b0b24c
Compare
There was a problem hiding this 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
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$