-
Notifications
You must be signed in to change notification settings - Fork 270
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
async support for ClientSessionDelegate in the FFI #4516
Comments
Out of curiosity, what kind of hardships did you run into? Calling a sync function from an async one should work OK in general; it's the other way around that's usually more complicated. Can you explicit what you mean by |
Yeah, the issues I hit were related to the OIDC refresh process, i.e. a NotificationServiceExtension gets a new refresh token, storing it in the system keychain, and now the main process needs to be able to read this back (via the ClientSessionDelegate interface). Right now the API defines that as a blocking call |
Thanks for the detailed explanation. Could you open a PR, please, so that we get an idea of the changes that would be required? If they're not too invasive, we think it'd be fine to take them — but I can't really make any sort of promise until we see what these changes are :) |
At the moment the FFI bindings for interacting with the keychain are both blocking (non-async) functions. Unfortunately the host language I am using this with (react-native) features an async keychain, presenting some challenges, especially with 'reloading' the keychain when dealing with OIDC locks.
I've locally made a change to use an async_trait here and it seems to be working just fine. It required some adjustment of the traits in matrix_sdk::authentication as well since async functions cannot be passed quite as easily, but its not too bad.
Would be happy to package this up and merge it if there is appetite for such a change.
The text was updated successfully, but these errors were encountered: