okta / okta-react-native

OIDC enablement for React Native applications
https://github.com/okta/okta-react-native
Other
59 stars 39 forks source link

UI thread blocking in OktaSdkBridgeModule causing app unresponsiveness #429

Open anujsachan1990 opened 1 week ago

anujsachan1990 commented 1 week ago

Describe the bug?

The OktaSdkBridgeModule is currently performing several operations on the main UI thread, which can lead to app unresponsiveness, especially on devices with limited resources or slow network connections. This affects methods such as createConfig, signIn, and authenticate.

This may be unnoticeable in a few devices but I can see it clearly in Pixel 6,7,8 which are not too old devices. The UI Thread should not be blocked.

The Fix is here: https://github.com/okta/okta-react-native/pull/428

What is expected to happen?

The app should remain responsive during Okta SDK operations, with no noticeable UI freezing or lag.

What is the actual behavior?

The app becomes unresponsive or experiences significant lag during Okta SDK operations, particularly on slower devices or networks.

Reproduction Steps?

  1. Initialize the Okta SDK using createConfig
  2. Attempt to sign in using signIn or authenticate method
  3. Observe UI responsiveness, especially on slower devices or networks

Additional Information?

https://github.com/user-attachments/assets/36b489be-2ff1-4439-8840-10dff45

when this method is called it blocked the UI thread Screenshot 2024-09-06 at 4 09 51 pm 70268

SDK Version

"@okta/okta-react-native": "^2.8.0",

Build Information

No response

anujsachan1990 commented 1 week ago

fix is here if anyone wat to use patch-package https://github.com/okta/okta-react-native/pull/428 @okta+okta-react-native+2.12.0.patch