ma1uta / matrix-synapse-rest-password-provider

Password Provider for Synapse fetching data from a REST endpoint
GNU Affero General Public License v3.0
27 stars 17 forks source link

Users in auto-joined rooms have empty display name #1

Open MurzNN opened 4 years ago

MurzNN commented 4 years ago

New Synapse have auto_join feature, that automatically joins new users to needed rooms.

But the problem when using with matrix-synapse-rest-password-provider, that users, auto-joined to those rooms, have empty (equal login) display name, instead of configured via ma1sd display name (on my setup name is auto-filled from LDAP via ma1sd) in this room. In new rooms, in which users joined or invited manually, display name shows well. If user manually change (set again) his display name globally in settings, it updated successfully in all rooms.

Seems auto_join event happens before matrix-synapse-rest-password-provider set right display name to user? Can you lookup, is it possible to fix this issue in matrix-synapse-rest-password-provider module, or it need some changes in Synapse?

MurzNN commented 4 years ago

Synapse auto_join function is here: https://github.com/matrix-org/synapse/blob/master/synapse/handlers/register.py#L274, it called at post_consent_actions event.

christopheg commented 4 years ago

I think the PR broke something:

2020-07-30 13:10:13,411 - synapse.http.server - 83 - ERROR - POST-73- Failed handle request via 'LoginRestServlet': <SynapseRequest at 0x7f11f3b11908 method='POST' uri='/_matrix/client/r0/login' clientproto='HTT
P/1.0' site=8008>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: @USER:SERVER

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/synapse/http/server.py", line 228, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/lib/python3/dist-packages/synapse/http/server.py", line 399, in _async_render
    callback_return = await raw_callback_return
  File "/usr/lib/python3/dist-packages/synapse/rest/client/v1/login.py", line 162, in on_POST
    result = await self._do_other_login(login_submission)
  File "/usr/lib/python3/dist-packages/synapse/rest/client/v1/login.py", line 280, in _do_other_login
    identifier["user"], login_submission
  File "/usr/lib/python3/dist-packages/synapse/handlers/auth.py", line 722, in validate_login
    is_valid = await provider.check_password(qualified_user_id, password)
  File "/usr/lib/python3/dist-packages/rest_auth_provider.py", line 85, in check_password
    store = await self.account_handler._hs.get_profile_handler().store  # for synapse >= 1.9.0
TypeError: object DataStore can't be used in 'await' expression