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

Synapse accepts optional unspecced servers field in PUT directory/room/{roomAlias} #14177

Open
DMRobertson opened this issue Oct 13, 2022 · 2 comments
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. X-Consult-Clients Need to investigate if this change breaks clients Z-Cleanup Things we want to get rid of, but aren't actively causing pain

Comments

@DMRobertson
Copy link
Contributor

Spec: https://spec.matrix.org/v1.4/client-server-api/#put_matrixclientv3directoryroomroomalias

servers = content["servers"] if "servers" in content else None
logger.debug("Got room_id: %s", room_id)
logger.debug("Got servers: %s", servers)
# TODO(erikj): Check types.
room = await self.store.get_room(room_id)
if room is None:
raise SynapseError(400, "Room does not exist")
requester = await self.auth.get_user_by_req(request)
await self.directory_handler.create_association(
requester, room_alias_obj, room_id, servers
)

Forwarded to here

await self._create_association(room_alias, room_id, servers, creator=user_id)
and to here
await self.store.create_room_alias_association(
room_alias, room_id, servers, creator=creator
)
and eventually written to the database here
self.db_pool.simple_insert_many_txn(
txn,
table="room_alias_servers",
keys=("room_alias", "server"),
values=[(room_alias.to_string(), server) for server in servers],
)

@DMRobertson DMRobertson added A-Spec-Compliance places where synapse does not conform to the spec S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. O-Uncommon Most users are unlikely to come across this or unexpected workflow X-Consult-Clients Need to investigate if this change breaks clients Z-Cleanup Things we want to get rid of, but aren't actively causing pain labels Oct 13, 2022
@DMRobertson
Copy link
Contributor Author

Should be easy enough to drop this: we can simply ignore the field.

@DMRobertson
Copy link
Contributor Author

But first we should check to see if it's in use in a meaningful way (i.e. in a way that differs to what servers=None would provide).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. X-Consult-Clients Need to investigate if this change breaks clients Z-Cleanup Things we want to get rid of, but aren't actively causing pain
Projects
None yet
Development

No branches or pull requests

1 participant