launchdarkly / react-native-client-sdk

LaunchDarkly Client-side SDK for React Native
Other
45 stars 32 forks source link

Privacy manifest file collides with local project privacy manifest file #264

Closed jesse-one-app closed 3 weeks ago

jesse-one-app commented 2 months ago

Describe the bug The privacy manifest file exported by Launch darkly conflicts with a projects local privacy file causing a build failure

To reproduce Include the latest Launch darkly sdk into a project with an existing privacy manifest file

Expected behavior Build should pass

SDK version 9.2.0

OS/platform iOS

Additional context It appears the issue has been resolved in the launch darkly ios-client-sdk v9.6.1, the react native package needs to adopt that newer version of the companion sdk

denissb commented 2 months ago

Facing the same issue on LD SDK 8.2.0

It was fixed in the following commit on the originating ios-client-sdk: https://github.com/launchdarkly/ios-client-sdk/commit/971a4c4abb6144c80af5af3b71f4336dde917f20

I think both versions 9.2.0 and 8.2.0 need to be patched (as 9.2.0 is not recommended for apps using RN <=0.73 and old arch)

louis-launchdarkly commented 2 months ago

Hello, @jesse-one-app and @denissb, thank you for reporting this, we have filed this internally as 242758 and will work on a fix for this.

cbaucom commented 1 month ago

Hi @louis-launchdarkly, is there a way to track the status of 242758? I'm curious when we might see a patch for SDK 8.2.0. Thank you

hmcpheewes commented 1 month ago

If it helps, after updating to react native 0.74.1, we downgraded the library to 8.0.2 to temporarily get around the issue

denissb commented 1 month ago

If you are on version 8.20 and don't want to downgrade as a workaround you can try to use the following script to patch the SDK in a postinstall step or use patch-package to overwrite "LaunchDarkly", "9.5.1" with "LaunchDarkly", "9.6.2"

import fs from 'fs/promises';
import path from 'path';

const __dirname = path.dirname(new URL(import.meta.url).pathname);

const replaceInFile = async (filePath, searchValue, replaceValue) => {
    const data = await fs.readFile(filePath, 'utf8');
    const result = data.replace(searchValue, replaceValue);

    await fs.writeFile(filePath, result, { encoding: 'utf8' });
    console.log(`Replaced Pod resource bundles in ${filePath}`);
};

const buildPluginFile = path.join(
    __dirname,
    './node_modules/launchdarkly-react-native-client-sdk/launchdarkly-react-native-client-sdk.podspec',
);

(async () => {
    await replaceInFile(
        buildPluginFile,
        's.dependency "LaunchDarkly", "9.5.1"',
        's.dependency "LaunchDarkly", "9.6.2"',
    );
})();

It worked fine for me without any issues.

tanderson-ld commented 3 weeks ago

Hello everyone. We have released version 9.3.0 of the react-native-client-sdk that bumps the internal ios-client-sdk to incorporate this fix.