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

Commit 82ba5fe

Browse files
committed
Releasing version 4.0.2
1 parent 3fdd006 commit 82ba5fe

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the LaunchDarkly React Native SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [4.0.2] - 2021-04-23
6+
### Fixed:
7+
- Android: Fixed an issue where the `jsonVariationDetail` method in `LDClient` returned `Promise<Record<string, any>>` instead of the declared return type of `Promise<LDEvaluationDetail<Record<string, any>>>`.
8+
59
## [4.0.1] - 2021-04-06
610
### Fixed:
711
- iOS: Internal throttling logic would sometimes delay new poll or stream connections even when there were no recent connections. This caused switching active user contexts using `identify` to sometimes delay retrieving the most recent flags, and therefore delay the completion of the returned Promise.

android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,11 @@ private void resolveJsonElement(Promise promise, JsonElement jsonElement) {
758758
}
759759

760760
private void resolveJsonElementDetail(Promise promise, EvaluationDetail<JsonElement> jsonElementDetail) {
761-
JsonElement jsonElement = jsonElementDetail.getValue();
762-
resolveJsonElement(promise, jsonElement);
761+
JsonObject jsonObject = new JsonObject();
762+
jsonObject.add("value", jsonElementDetail.getValue());
763+
jsonObject.addProperty("variationIndex", jsonElementDetail.getVariationIndex());
764+
jsonObject.add("reason", gson.toJsonTree(jsonElementDetail.getReason()));
765+
resolveJsonElement(promise, jsonObject);
763766
}
764767

765768
/**

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class LDClient {
120120

121121
jsonVariationDetail(flagKey, defaultValue) {
122122
if (defaultValue == undefined) {
123-
return LaunchdarklyReactNativeClient.jsonVariatioDetailNone(flagKey);
123+
return LaunchdarklyReactNativeClient.jsonVariationDetailNone(flagKey);
124124
} else if (typeof defaultValue === 'number') {
125125
return LaunchdarklyReactNativeClient.jsonVariationDetailNumber(flagKey, defaultValue);
126126
} else if (typeof defaultValue === 'boolean') {

ios/LaunchdarklyReactNativeClient.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = "LaunchdarklyReactNativeClient"
4-
s.version = "4.0.1"
4+
s.version = "4.0.2"
55
s.summary = "LaunchdarklyReactNativeClient"
66
s.description = <<-DESC
77
LaunchdarklyReactNativeClient

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "launchdarkly-react-native-client-sdk",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"description": "",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)