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

Improve room alias management #618

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

nvrWhere
Copy link
Collaborator

  • modify setCanonicalAlias and setLocalAliases to prevent the same alias being the canonical and an alt alias (the server doesn't prevent this)
  • add functions to connection to map and unmap aliases on the server
  • add function to map an alias to the current room on the server

James Graham added 2 commits February 10, 2023 19:48
- modify setCanonicalAlias and setLocalAliases to prevent the same alias being the canonical and an alt alias (the server doesn't prevent this)
- add functions to connection to map and unmap aliases on the server
- add function to map an alias to the current room on the server
Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

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

Before a detailed review, two questions:

  1. The specification seems to have no opinion on whether an alias can be a canonical one and included in alt_aliases. Did you discuss it anywhere (in #matrix-spec, e.g.)? It would be great to cover this gap (if it is confirmed) to avoid different clients acting differently. And in fact, making the servers do the right changes would ultimately be the best solution.
  2. No need to write the actual code but what do you expect the test for Connection::mapAlias() would look like? I struggle to find a good criteria of this operation's completion. For reference, Connection::forgetRoom(), being an orchestration of two API calls too, returns a pointer to the last job so that callers (including tests) could connect to its finished() signal. Perhaps it's worth having the same logic here - once we have point 1 sorted out.

@KitsuneRal KitsuneRal added the enhancement A feature or change request for the library label Feb 12, 2023
@nvrWhere
Copy link
Collaborator Author

Before a detailed review, two questions:

1. The specification seems to have no opinion on whether an alias can be a canonical one and included in `alt_aliases`. Did you discuss it anywhere (in [#matrix-spec](https://matrix.to/#/#matrix-spec:matrix.org), e.g.)? It would be great to cover this gap (if it is confirmed) to avoid different clients acting differently. And in fact, making the servers do the right changes would ultimately be the best solution.

2. No need to write the actual code but what do you expect the test for `Connection::mapAlias()` would look like? I struggle to find a good criteria of this operation's completion. For reference, `Connection::forgetRoom()`, being an orchestration of two API calls too, returns a pointer to the last job so that callers (including tests) could `connect` to its `finished()` signal. Perhaps it's worth having the same logic here - once we have point 1 sorted out.

For 1. I have to admit this is me just pushing this the next level down from what I did in neochat and your right that ideally it should try an be resolved at the spec level as it current say nothing. I'll ask when I get a chance.

For 2. I agree as it stands right now the function does just start the job and hope. So returning the job pointer seems like the best way forward so that the errors can be checked if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for the library
Projects
Status: 0.9 - To Do
Development

Successfully merging this pull request may close these issues.

2 participants