configcat / node-sdk

ConfigCat SDK for Node.js. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/node
MIT License
19 stars 7 forks source link

SDK gets out of sync ofter running for a couple of days #39

Closed leeran88 closed 2 years ago

leeran88 commented 2 years ago

Describe the bug

We encountered an issue in our production services - after a few days, suddenly the ConfigCat client gets out of sync and returns old values when calling getValueAsync or getAllValues. When it happens, the client will no longer gets the updated values. There are also no logs when this happens.

We initialize the client as a singleton, and use the default auto polling.

I also talked about this issue couple of weeks ago here https://github.com/configcat/common-js/issues/36#issuecomment-1094599625

Will appreciate your quick help, since this is effecting our production environment.

To reproduce

Reproducing this issue is hard, because it happens after a few days the service is running. Suddenly it gets out of sync, and doesn't get updated values.

Expected behavior

Get the updated values when calling getValueAsync or getAllValues.

SDK version

6.7.1

SDK configuration

Initialization:

let client;

function initialize({ sdkKey }) {
    try {
        client = configcat.createClient(sdkKey);
    } catch (e) {
        throw new Error('Failed initializing the configcat feature control.');
    }
}

function getClient() {
    if (!client) {
        throw new Error('client is not initialized yet.');
    }

    return client;
}

Usage:

const client = getClient();

const user = { ... };

const value = await client.getValueAsync(key, false, user);

Logs

None

Language/Framework version

NodeJs 16.13.1

laliconfigcat commented 2 years ago

Hello @leeran88,

Could you please join our community slack and contact me there so we can discuss your issue in a bit more detail (I'll need some sensitive information): https://configcat.com/slack. You can find me there: Lali from ConfigCat.

Cheers,

laliconfigcat commented 2 years ago

Hello @leeran88,

Based on the discussion on slack - the issue is not happening anymore - I am closing this issue. If the issue comes up again, please write to us.

Cheers

leeran88 commented 2 years ago

@laliconfigcat thank you for the support!