Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

6.2.3 is completely broken on Android #157

Closed
i1skn opened this issue Oct 6, 2022 · 4 comments
Closed

6.2.3 is completely broken on Android #157

i1skn opened this issue Oct 6, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@i1skn
Copy link

i1skn commented Oct 6, 2022

Describe the bug
6.2.3 is completely broken for Android

To reproduce
Launch ManualTestApp on Android using 6.2.3
Observe in console ERROR [Error: LaunchDarkly SDK already initialized] immediately after run.

Expected behavior
Calling .configure(...) should not resolve into an LaunchDarkly SDK already initialized error neither at the start of the app, nor after we call .close() and then .configure(...) again.

SDK version
6.2.3

OS/platform
Android 12

Additional context
This happens because .isInitialized(...) used to return a rejected Promise, when client is not available and since 6.2.3 (as pointed here) it resolves with false.

If you look on the code below, you'll see, that if .isInitialized(...) is not rejected -> we throw an error, but right we do not reject it, hence we see a vicious cycle.

On 6.2.2 .isInitialized(...) would resolve with false after you've called .close() instead of rejecting (see here this issue).

So, 6.2.3 is completely unusable on Android.

configure(config, user, timeout) {
return LaunchdarklyReactNativeClient.isInitialized("default")
.then(
ignored => {
throw new Error('LaunchDarkly SDK already initialized');
},
() => {
const configWithOverriddenDefaults = Object.assign({
backgroundPollingIntervalMillis: 3600000, // the iOS SDK defaults this to 900000
disableBackgroundUpdating: false, // the iOS SDK defaults this to true
pollUri: 'https://clientsdk.launchdarkly.com',
wrapperName: 'react-native-client-sdk',
wrapperVersion: this.getVersion()
}, config);
if (timeout == undefined) {
return LaunchdarklyReactNativeClient.configure(configWithOverriddenDefaults, user);
} else {
return LaunchdarklyReactNativeClient.configureWithTimeout(configWithOverriddenDefaults, user, timeout);
}
}
);
}

@mfelix5
Copy link

mfelix5 commented Oct 6, 2022

Same issue.

@louis-launchdarkly
Copy link
Contributor

Hello @i1skn and @mfelix5, thank you for reporting this issue - this is a serious issue and we are looking into it - for unblocking the people using this, we are looking to first revert this part of the isInitialized change to provide a leapfrogged 6.2.4 first and have a separate fix for how isInitialized is used. Before we have a fix, please pin to use 6.2.2 for now.

We will update this when we have a release.

@louis-launchdarkly louis-launchdarkly changed the title 6.2.3 is completely broken on Android 6.2.3 is completely broken on Android [LaunchDarkly Note: Please pin to use 6.2.2 for now] Oct 6, 2022
@louis-launchdarkly louis-launchdarkly added the bug Something isn't working label Oct 6, 2022
@louis-launchdarkly louis-launchdarkly self-assigned this Oct 6, 2022
@louis-launchdarkly louis-launchdarkly changed the title 6.2.3 is completely broken on Android [LaunchDarkly Note: Please pin to use 6.2.2 for now] 6.2.3 is completely broken on Android Oct 6, 2022
@louis-launchdarkly
Copy link
Contributor

Hello @i1skn and @mfelix5, we have just released the fix as 6.2.4. Please test this out and let us know if there is anything else.

@i1skn
Copy link
Author

i1skn commented Oct 7, 2022

@louis-launchdarkly thanks so much for such a quick fix! Seems like both issues were fixed in 6.2.4!

LaunchDarklyReleaseBot pushed a commit that referenced this issue Jun 22, 2023
This is a bugfix for the publicly submitted issue:
#160

where `getLastSuccessfulConnection` and `getLastFailedConnection` can
result in a null exception.

---------

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants