v1.2.22
This release includes several key improvements and a critical bug fix in the Android Kotlin SDK. These updates enhance the token refresh mechanism, introduce robust error handling, and improve the overall reliability of the SDK.
Key Changes:
-
Sustainable Token Refresh Mechanism:
- Foreground: Implemented
TimerTask
to trigger immediate token refresh after the specified delay, ensuring timely execution without delays caused byJobScheduler
's battery optimization. - Background: Utilized
JobScheduler
to handle token refresh in the background, conserving battery when the app is not in the foreground. - Retry Mechanism for Background Jobs: Introduced a retry mechanism that automatically retries the token refresh after 5 seconds if the background job fails.
- Seamless Switching: Added logic to cancel the current timer or job and reschedule a new one based on the application’s state (foreground or background).
- Edge Case Handling: Implemented logic to immediately refresh tokens if the remaining offset is below 15 seconds when transitioning from background to foreground, especially when token expiration is imminent (~800ms).
- Token Refresh Status Check: Added support for checking if the token is currently being refreshed, allowing users to verify the refresh status before using the token.
- Foreground: Implemented
-
Fix for Infinite Loading State on OAuth/Authorize Error:
- Resolved an issue where the application would enter an infinite loading state on the
/oauth/authorize
page when an error occurred. - This bug was introduced when changes were made to the error page in the hosted login webpage, causing the SDK to fail in catching and handling the error correctly.
- The SDK now accurately identifies when the page contains an error while still on the
/oauth/authorize
path and displays the actual response received from the backend, preventing the infinite loading loop.
- Resolved an issue where the application would enter an infinite loading state on the
Impact:
These updates ensure a reliable and energy-efficient token refresh process across different app states, improve error handling during OAuth authorization, and prevent the infinite loading issue, thereby enhancing the overall user experience and robustness of the SDK.