Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaunchDarklyClientError: Unknown feature flag on Android #472

Open
nadSTC opened this issue May 24, 2024 · 1 comment
Open

LaunchDarklyClientError: Unknown feature flag on Android #472

nadSTC opened this issue May 24, 2024 · 1 comment
Labels
bug Something isn't working package: sdk/react-native Issues that affect the react native SDK. waiting for feedback Indicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness.

Comments

@nadSTC
Copy link

nadSTC commented May 24, 2024

Describe the bug
Getting a 'not found' error when trying to retrieve feature flags on android specifically. My project is in react native using expo. I can confirm that the exact same code works for iOS in both device and simulator. Here is how i set up my launch darkly client

I can confirm that all my flags have the SDKs using Mobile key checked as well.

import { ReactNode, useEffect } from "react";
import {
  LDProvider,
  LDContext,
  ReactNativeLDClient,
  AutoEnvAttributes,
} from "@launchdarkly/react-native-client-sdk";
import envConfig from "../util/env.config";
import { useAuth } from "./AuthContext";

const client = new ReactNativeLDClient(
  envConfig.launchDarkly.mobileKey,
  AutoEnvAttributes.Enabled
);

export const LaunchDarklyProvider = ({ children }: { children: ReactNode }) => {
  const { user } = useAuth();

  async function identify() {
    const context: LDContext = {
      kind: "user",
      key: user?.email || "anonymous",
    };
    await client.identify(context);
  }

  useEffect(() => {
    (async () => {
      await identify();
    })();
  }, [user?.email]);

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

I'm retrieving my flag values using useBoolVariation, useStringVariation etc.

Expected behavior
Feature flag values should propogate

Logs
same error for all my flags in android

 LOG  error: [LaunchDarkly] error: LaunchDarklyClientError: Unknown feature flag "<featureFlagName>"; returning default value false., context: {"kind":"multi","user":{"k
ey":"anonymous"},"ld_device":{"envAttributesVersion":"1.0","manufacturer":"Google","m
odel":"sdk_gphone64_arm64","os":{"name":"android","version":"34","family":"android"},
"key":"f8f3baaa-5338-4d88-bd77-c923cd7a626c"}}

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
Android

@nadSTC nadSTC added bug Something isn't working package: sdk/react-native Issues that affect the react native SDK. labels May 24, 2024
@yusinto
Copy link
Contributor

yusinto commented May 31, 2024

If you are running Android in debug in the simulator, there is a known issue with Flipper blocking streaming network connections in debug mode. Please see this pinned issue and see if this resolves it.

@yusinto yusinto added the waiting for feedback Indicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness. label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package: sdk/react-native Issues that affect the react native SDK. waiting for feedback Indicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness.
Projects
None yet
Development

No branches or pull requests

2 participants