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

Support for LaunchDarkly's contexts upgrade #409

Closed
tniezurawski opened this issue Mar 15, 2023 · 5 comments · Fixed by #429
Closed

Support for LaunchDarkly's contexts upgrade #409

tniezurawski opened this issue Mar 15, 2023 · 5 comments · Fixed by #429

Comments

@tniezurawski
Copy link

LaunchDarkly plans changes in a way they track monthly usage. They will start the changes from the 1st of April and switch from MAU (Monthly Active Users) to MCI (Monthly Context Instances). You can read more about it here: https://docs.launchdarkly.com/guides/flags/upgrading-contexts.

To use contexts we would have to bump launchdarkly-js-client-sdk to version 3.0.0. I'm not yet sure what would be involved in the addon to start supporting it but just wanted to flag it

@tniezurawski
Copy link
Author

tniezurawski commented Mar 16, 2023

It looks it should be as easy as setting an extra property to pass to identify() method:

let customProps = {
 someKey: 'some-value'
};
let props = {
  key: user.id,
  kind: 'my-new-context',  // "user" by default
  anonymous: false,
  custom: customProps,
};

await identify(props);

I think no changes, besides bumping launchdarkly-js-client-sdk to version 3.0.0, would be needed.


Feel free to close it, or close when we have the SDK upgraded 👌

@SkoebaSteve
Copy link
Collaborator

@tniezurawski thanks for sharing this. It's on my list to verify this at Qonto next week so if it's all ✅ we'll bump it after that.

@SkoebaSteve
Copy link
Collaborator

I validated it on our side and there's no breaking change with the addon as far as I can see so I merged it, it will be part of our new v3 release where we will drop some older ember/node versions.

I'll keep you posted, should be this week

@tniezurawski
Copy link
Author

Great stuff @SkoebaSteve 🙌 I'm not super familiar with internals here and probably don't use everything that is possible in this addon but do you think this code:

return this.client.getUser();

might be affected by a breaking change and should be tweaked?

LDClient.getUser has been replaced with LDClient.getContext.

@SkoebaSteve
Copy link
Collaborator

@tniezurawski yep you're right, we actually were not relying on the user getter here ourselves but it breaks indeed:

image

I'll create a fix for this, thanks for spotting!

@SkoebaSteve SkoebaSteve mentioned this issue Mar 23, 2023
7 tasks
SkoebaSteve pushed a commit that referenced this issue Apr 3, 2023
SkoebaSteve pushed a commit that referenced this issue Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants