launchdarkly / js-core

LaunchDarkly monorepo for JavaScript SDKs
Other
12 stars 12 forks source link

[LaunchDarklyTimeoutError: identify timed out after 5 seconds.] #457

Closed samtags closed 1 month ago

samtags commented 1 month ago

Describe the bug LaunchDarklyTimeoutError log is showing when running the app in Android and not getting the correct variation value.

To reproduce Render this component at the top level of your app. Run the app in Android device and you will see the error.

import {
  LDProvider,
  ReactNativeLDClient,
  AutoEnvAttributes,
} from "@launchdarkly/react-native-client-sdk";
import { useEffect } from "react";

const ctx = {
  kind: "user",
  key: "anonymous-key",
  debug: true,
};

const client = new ReactNativeLDClient(
  "PROJECT_KEY",
  AutoEnvAttributes.Disabled
);

const LaunchdarklyProvider = ({ children }) => {
  useEffect(() => {
    client.identify(ctx).catch((e) => console.log(e));
  }, []);

  return <LDProvider client={client}>{children}</LDProvider>;
};

export default LaunchdarklyProvider;

Expected behavior The error should not show and should be able to get the correct variation value.

Logs LOG error: [LaunchDarkly] identify error: LaunchDarklyTimeoutError: identify timed out after 5 seconds. LOG [LaunchDarklyTimeoutError: identify timed out after 5 seconds.]

SDK version "@launchdarkly/react-native-client-sdk": "10.1.1"

Language version, developer tools "react-native": "0.73.6" "expo": "~50.0.17"

OS/platform

Additional context Works fine in iOS issue only occurs in Android.

QuanGao-osmind commented 1 month ago

➕1 We are seeing the same error in our Android simulators and physical devices.

patrickcbrady commented 1 month ago

➕1 We are seeing the same error in our Android simulators and physical devices.

sdk version: 10.1.3 react-native: 0.72.10 expo: 49.0.23

samtags commented 1 month ago

Issue was resolved when flipper is removed from build.gradle and Mainapplication.kt. I found it here.