From ce5c566867481274d5812c81dcaffd56f80ad8ae Mon Sep 17 00:00:00 2001 From: Ember Stevens Date: Wed, 7 Jun 2023 20:55:44 -0700 Subject: [PATCH 1/2] Updates daily flag count --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7dc1b33..85b4ecb 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## LaunchDarkly overview -[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today! +[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today! [![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly) @@ -24,7 +24,7 @@ Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/client-side/r ## Learn more -Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react/react-native). +Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react/react-native). ## Testing From 13b1544dc035ace5edac7577bbe2583a27039172 Mon Sep 17 00:00:00 2001 From: Yusinto Ngadiman Date: Tue, 20 Jun 2023 13:07:22 -0700 Subject: [PATCH 2/2] [173523] Check for nulls when calling getLastXXX (#157) This is a bugfix for the publicly submitted issue: https://github.com/launchdarkly/react-native-client-sdk/issues/160 where `getLastSuccessfulConnection` and `getLastFailedConnection` can result in a null exception. --------- Co-authored-by: Yusinto Ngadiman --- .../LaunchdarklyReactNativeClientModule.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java b/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java index e940433..cd2946b 100644 --- a/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java +++ b/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java @@ -39,7 +39,6 @@ import com.launchdarkly.sdk.android.LDConfig; import com.launchdarkly.sdk.android.LDFailure; import com.launchdarkly.sdk.android.LDStatusListener; -import com.launchdarkly.sdk.android.LaunchDarklyException; import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder; import com.launchdarkly.sdk.android.integrations.EventProcessorBuilder; import com.launchdarkly.sdk.android.integrations.HttpConfigurationBuilder; @@ -636,7 +635,12 @@ public void getConnectionMode(String environment, Promise promise) { @ReactMethod public void getLastSuccessfulConnection(String environment, Promise promise) { try { - promise.resolve(LDClient.getForMobileKey(environment).getConnectionInformation().getLastSuccessfulConnection().intValue()); + Long lastSuccessfulConnection = LDClient.getForMobileKey(environment).getConnectionInformation().getLastSuccessfulConnection(); + if (lastSuccessfulConnection != null) { + promise.resolve(lastSuccessfulConnection.doubleValue()); + } else { + promise.resolve(null); + } } catch (Exception e) { Timber.w(e, "Warning: exception caught in getLastSuccessfulConnection"); promise.resolve(0); @@ -646,7 +650,13 @@ public void getLastSuccessfulConnection(String environment, Promise promise) { @ReactMethod public void getLastFailedConnection(String environment, Promise promise) { try { - promise.resolve(LDClient.getForMobileKey(environment).getConnectionInformation().getLastFailedConnection().intValue()); + Long lastFailedConnection = LDClient.getForMobileKey(environment).getConnectionInformation().getLastFailedConnection(); + if (lastFailedConnection != null) { + promise.resolve(lastFailedConnection.doubleValue()); + } else { + promise.resolve(null); + } + } catch (Exception e) { Timber.w(e, "Warning: exception caught in getLastFailedConnection"); promise.resolve(0);