Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public static class SdkConfigServiceEndpointParams {

public static class SdkConfigClientSideParams {
LDContext initialContext;
LDContext initialUser;
boolean evaluationReasons;
boolean useReport;
boolean usePost;
Expand Down Expand Up @@ -186,6 +187,7 @@ public static class TrackSeriesCallbackParams {

public static class IdentifyEventParams {
LDContext context;
LDContext user;
}

public static class CustomEventParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ public SdkClientEntity(Application application, CreateInstanceParams params, LDL
long startWaitMs = params.configuration.startWaitTimeMs != null ?
params.configuration.startWaitTimeMs.longValue() : 5000;
Representations.SdkConfigClientSideParams clientSideParams = params.configuration.clientSide;
Future<LDClient> initFuture = LDClient.init(application, config, clientSideParams.initialContext);
// An old-style user arrives as JSON with no "kind"; LDContext's Gson adapter converts it.
LDContext initialContext = clientSideParams.initialContext != null ?
clientSideParams.initialContext : clientSideParams.initialUser;
Future<LDClient> initFuture = LDClient.init(application, config, initialContext);
// Try to initialize client, but if it fails, keep going in case the test harness wants us to
// work with an uninitialized client
try {
Expand Down Expand Up @@ -213,7 +216,7 @@ private EvaluateAllFlagsResponse doEvaluateAll(EvaluateAllFlagsParams params) {

private void doIdentifyEvent(IdentifyEventParams params) {
try {
client.identify(params.context).get();
client.identify(params.context != null ? params.context : params.user).get();
} catch (ExecutionException | InterruptedException e) {
throw new RuntimeException("Error waiting for identify", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public class TestService extends NanoHTTPD {
"retry-conformance-fdv1-streaming",
"retry-conformance-fdv1-polling",
"client-use-post",
"fdv1-fallback"
"fdv1-fallback",
"user-type"
};
private static final String MIME_JSON = "application/json";
static final Gson gson = new GsonBuilder()
Expand Down