-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Password provider does not work properly since Synapse v1.19.0 due to "user_get_threepids" is now async #8108
Comments
I don't have intimate knowledge of this area of the code but I can offer some suggestions. You may need to do yield ensureDeferred(store.user_get_threepids(user_id)) which converts the coroutine to a Deferred. (My understanding, which may be wrong, is that yield will only deal with Deferreds, whilst other values (including coroutines) will get passed straight through as though there was no yield). Or, ideally, if/when possible, switch from @defer.inlineCallbacks
def check_3pid_auth(self, medium, address, password): to async def check_3pid_auth(self, medium, address, password): (and use You may need other code changes to make this work. |
In this case you would need to switch all |
I'll take a look, but I suspect this is because private properties are being used which aren't expected to be exposed as part of the password provider API. |
I'm going to close this since password providers are really only expected to use the public methods on the config and There's not really anything to stop you from doing that in Python, but converting the code to be async is the right solution here IMO! 👍 If there is additional functionality that the I'd also be curious if your password provider is open source / what functionality it provides as I was recently looking for examples of these. 😄 |
It looks like #7734 might be related to what you'd like? |
@menturion heads up there's another modified version of that password provider here: https://github.com/ma1uta/matrix-synapse-rest-password-provider which may or may not be useful to you :) |
@menturion Ah, no, that repo may not be aware of this yet either. I'll create an issue to warn them and point to your above comment with the required changes. |
After upgrading to Synapse v1.19.0 the following exception is thrown within a password provider :
The affected piece of code of the password provider looks like this:
This is obviously due to "user_get_threepids" is defined async since Synapse v1.19.0, see in "registration.py" # 526,
synapse/synapse/storage/databases/main/registration.py
Line 526 in 3234d5c
So my question is:
How to request the user's threepids (asynchronously) within a password provider?
The text was updated successfully, but these errors were encountered: