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

Add missing servers field in /directory/room/:alias response #732

Open
wants to merge 5 commits into
base: master
from

Conversation

@Cnly
Copy link
Collaborator

commented Jul 9, 2019

Fixes #659.

Signed-off-by: Alex Chen minecnly@gmail.com

Pull Request Checklist

  • I have added any new tests that need to pass to testfile as specified in docs/sytest.md
  • Pull request includes a sign off
Add missing servers field in /directory/room/:alias response
Signed-off-by: Alex Chen <minecnly@gmail.com>

@anoadragon453 anoadragon453 added this to In progress in Homeserver Task Board via automation Jul 9, 2019

@anoadragon453 anoadragon453 removed this from In progress in Homeserver Task Board Jul 9, 2019

@anoadragon453 anoadragon453 self-assigned this Jul 9, 2019

@anoadragon453 anoadragon453 self-requested a review Jul 11, 2019

@anoadragon453

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

So looking at Synapse's code, it:

Checks that the room is owned by itself:

https://github.com/matrix-org/synapse/blob/4806651744616bf48abf408034ab9560e33f60ce/synapse/handlers/directory.py#L235-L280

Then if it is, pulls the list of servers it knows are in a room from the DB and returns that:

https://github.com/matrix-org/synapse/blob/4806651744616bf48abf408034ab9560e33f60ce/synapse/storage/directory.py#L30-L63

I'm not quite sure why, if I'm not the server in the room_id, that I can't answer this query, and presumably this will break if the homeserver that originally created the room leaves it...

@Cnly

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 12, 2019

Depends on #781.

@anoadragon453

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

Can we add our own server to the servers slice?

@Cnly Cnly marked this pull request as ready for review Aug 23, 2019

@Cnly

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 23, 2019

I'm not quite sure why, if I'm not the server in the room_id, that I can't answer this query, and presumably this will break if the homeserver that originally created the room leaves it...

I'm afraid that'll also be Dendrite's behaviour because we don't (?) keep track of remote aliases...

Here Dendrite will first directly check if the alias association is local. If not, it sends a federation query to the domain in the ID. So if the server in the ID is down, this will break.

Can we add our own server to the servers slice?

If the alias is local and we're in that room (which should be impled), then we'll be in the list. If it's resolved via federation, then we'll just use whatever the remote server gives us.

Don't send federation queries to ourselves.
Signed-off-by: Alex Chen <minecnly@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.