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

home_server field in registration response is deprecated #103

Open
timmc opened this issue Mar 2, 2023 · 3 comments · May be fixed by #105
Open

home_server field in registration response is deprecated #103

timmc opened this issue Mar 2, 2023 · 3 comments · May be fixed by #105
Labels
bug Something isn't working

Comments

@timmc
Copy link
Contributor

timmc commented Mar 2, 2023

How did you install matrix-registration?

pip

What python version are you running?

3.9.2

What version of matrix-registration are you running?

latest

Your config.yml

No response

Your error log

[2023-03-01 03:32:00,027] ERROR in app: Exception on /register [POST]
Traceback (most recent call last):
  File "/srv/commdata/stg_matrix/regui/venv_py3.9.2/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/srv/commdata/stg_matrix/regui/venv_py3.9.2/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/srv/commdata/stg_matrix/regui/venv_py3.9.2/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/srv/commdata/stg_matrix/regui/venv_py3.9.2/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/srv/commdata/stg_matrix/regui/venv_py3.9.2/lib/python3.9/site-packages/matrix_registration/api.py", line 224, in register
    home_server=account_data["home_server"],
KeyError: 'home_server'

Area of your issue?

general usage

What happened

Dendrite v0.10.9 stopped sending the home_server field in the registration response, which breaks matrix-registration. It turns out this is deprecated (search for home_server) and I'm guessing it will be removed from Synapse in due time as well.

This causes registration to succeed but matrix-registration's backend returns a 500 and the UI appears to do nothing.

Steps to reproduce

No response

@timmc timmc added the bug Something isn't working label Mar 2, 2023
@spaetz
Copy link

spaetz commented Mar 3, 2023

To save a bit of time: the propsed solution is to split off the server part from the full user id instead of relying on the home_server value that used to be handed back.

timmc added a commit to timmc/matrix-registration that referenced this issue Mar 5, 2023
This field is deprecated in the client-server API and has been removed from
Dendrite, causing the UI to error when handling a registration response.

Reference: https://spec.matrix.org/v1.6/client-server-api/#post_matrixclientv3register

It appears that the `home_server` field wasn't actually being used here
anyhow, so just remove the line that tries to fetch it. The spec indicates
that if it is needed, the caller should instead split the user_id at the
first colon.

Fixes zeratax#103
@timmc
Copy link
Contributor Author

timmc commented Mar 5, 2023

Very simple PR to fix: #105 -- turns out the field was fetched from the response but wasn't actually used.

@spaetz
Copy link

spaetz commented Mar 5, 2023

Yay, code simplification:-). Thanks for the quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants