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

register_user() with bind_emails broken#6326

Closed
arekinath wants to merge 1 commit into
matrix-org:developfrom
arekinath:regemails
Closed

register_user() with bind_emails broken#6326
arekinath wants to merge 1 commit into
matrix-org:developfrom
arekinath:regemails

Conversation

@arekinath
Copy link
Copy Markdown

@arekinath arekinath commented Nov 5, 2019

This is still used by the ldap auth module (matrix-synapse-ldap3) but has been broken since pr #5964 was merged.

The ldap auth module is calling register() in the module API (the deprecated one which creates a dummy device), but even if it was updated to call the non-deprecated register_user it would still run into this problem -- register_user in the module API calls register_user in the registration handler with bind_emails set to the third argument, leading to this crash:

  File "/usr/local/synapse/lib/python3.7/site-packages/synapse/module_api/__init__.py", line 102, in register
    user_id = yield self.register_user(localpart, displayname, emails)
  File "/usr/local/synapse/lib/python3.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/usr/local/synapse/lib/python3.7/site-packages/synapse/handlers/register.py", line 260, in register_user
    yield self._register_email_threepid(user_id, threepid_dict, None, False)
  File "/usr/local/synapse/lib/python3.7/site-packages/twisted/internet/defer.py", line 1604, in unwindGenerator
    gen = f(*args, **kwargs)
TypeError: _register_email_threepid() takes 4 positional arguments but 5 were given

The fix is simply to stop giving the additional False argument to _register_email_threepid().

Signed-off-by: Alex Wilson alex@uq.edu.au

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file
  • Pull request includes a sign off

This is still used by the ldap auth module but has been broken since
pr matrix-org#5964 was merged

Signed-off-by: Alex Wilson <alex@uq.edu.au>
@richvdh
Copy link
Copy Markdown
Member

richvdh commented Dec 4, 2019

sorry, we missed this and it's now been sorted by #6441.

@richvdh richvdh closed this Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants