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

Use native callbacks instead of promise in createConfig #404

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

rajdeepnanua-okta
Copy link
Contributor

No description provided.

Copy link
Collaborator

@mikenachbaur-okta mikenachbaur-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Are you planning to trigger a release for this, to enable testing of this update?

@rajdeepnanua-okta
Copy link
Contributor Author

Looks good. Are you planning to trigger a release for this, to enable testing of this update?

Yep. @shuowu-okta can help us with releasing this. I'll add the release docs

@rajdeepnanua-okta rajdeepnanua-okta merged commit 2120f8c into master Jan 16, 2024
2 checks passed
@rajdeepnanua-okta rajdeepnanua-okta deleted the createConfig_callback branch January 16, 2024 20:08
@chukcha-wtf
Copy link

@rajdeepnanua-okta great work on this PR!
Can you please update the documentation for using createConfig?

I see that here

successResponse => {
createConfig is still marked as async call but there's nothing in the function itself that will follow the async/await pattern anymore.

I see that createConfig is now relying on callbacks but can't find a way to pass an onSuccess/onError callbacks to the createConfig call so there's no way to notify the app that createConfig() has resolved with either success or error. Or at least I've failed to find one.

And when I've tried calling createConfig like this:

  createConfig({
        clientId: "clientId", // actual value is different
        redirectUri: 'com.redirect:/',
        endSessionRedirectUri: 'com.redirect:/logout',
        discoveryUri: "issuerParam", // actual value is different
        scopes: ['openid', 'profile', 'offline_access'],
        requireHardwareBackedKeyStore: false,
    });

I started getting the fillowing error (it worked just fine in previous releases):

[[90,159,87],[10,0,0],[[18,25],[86,2000,1705519960326,false]],214]
Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.

@nikolal
Copy link

nikolal commented Jan 18, 2024

I can confirm I also have the same error:

Exception in HostFunction: Malformed calls from JS: field sizes are different

@rajdeepnanua-okta
Copy link
Contributor Author

@chukcha-wtf, the createConfig function contract remains the same as before. It's using callbacks internally, and the changes don't affect the API exposed to you.
@chukcha-wtf, @nikolal, are you encountering this issue on Android or iOS? I'm looking into this issue now.

@nikolal
Copy link

nikolal commented Jan 18, 2024

@rajdeepnanua-okta

I am experiencing this issue on IOS but I don't think it is connected to this MR.

It's happening on older versions too. -----> Not true, see EDIT below.

It started when i upgraded this lib earlier today so my error search brought me to this MR.

EDIT:

Actually it only happens on 2.11.0

I managed to make it work on 2.10.0 and ^2.8.0.

@rajdeepnanua-okta
Copy link
Contributor Author

@chukcha-wtf, @nikolal, we have released 2.11.1 which fixes issues with iOS, and also some hard to hit issues for Android. Let me know if it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants