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

fix(app-shell): to only events for flag variations #3426

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

tdeekens
Copy link
Contributor

@tdeekens tdeekens commented Mar 5, 2024

Summary

This attempts to reduce the flag evaluation to occur for flags we don't request. This is the result of a LD support ticket.

@tdeekens tdeekens requested a review from a team as a code owner March 5, 2024 14:36
Copy link

changeset-bot bot commented Mar 5, 2024

🦋 Changeset detected

Latest commit: e2a3691

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 37 packages
Name Type
@commercetools-frontend/application-shell Patch
@commercetools-frontend/cypress Patch
@commercetools-applications/merchant-center-template-starter-typescript Patch
@commercetools-applications/merchant-center-template-starter Patch
@commercetools-applications/merchant-center-custom-view-template-starter-typescript Patch
@commercetools-applications/merchant-center-custom-view-template-starter Patch
@commercetools-local/playground Patch
@commercetools-local/visual-testing-app Patch
@commercetools-backend/eslint-config-node Patch
@commercetools-backend/express Patch
@commercetools-backend/loggers Patch
@commercetools-frontend/actions-global Patch
@commercetools-frontend/application-components Patch
@commercetools-frontend/application-config Patch
@commercetools-frontend/application-shell-connectors Patch
@commercetools-frontend/assets Patch
@commercetools-frontend/babel-preset-mc-app Patch
@commercetools-frontend/browser-history Patch
@commercetools-frontend/codemod Patch
@commercetools-frontend/constants Patch
@commercetools-frontend/create-mc-app Patch
@commercetools-frontend/eslint-config-mc-app Patch
@commercetools-frontend/i18n Patch
@commercetools-frontend/jest-preset-mc-app Patch
@commercetools-frontend/jest-stylelint-runner Patch
@commercetools-frontend/l10n Patch
@commercetools-frontend/mc-dev-authentication Patch
@commercetools-frontend/mc-html-template Patch
@commercetools-frontend/mc-scripts Patch
@commercetools-frontend/notifications Patch
@commercetools-frontend/permissions Patch
@commercetools-frontend/react-notifications Patch
@commercetools-frontend/sdk Patch
@commercetools-frontend/sentry Patch
@commercetools-frontend/url-utils Patch
@commercetools-website/components-playground Patch
@commercetools-website/custom-views Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2024 8:50am

Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@tdeekens
Copy link
Contributor Author

tdeekens commented Mar 5, 2024

Thanks for the review. Will debug CI tomorrow.

Copy link
Contributor

@CarlosCortizasCT CarlosCortizasCT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Just to better understand what this change does: is it about evaluation in the server side so the request time would potentially be shorter?

@tdeekens tdeekens force-pushed the td/ld-variation-events branch from f2aa899 to b0beac6 Compare March 6, 2024 08:47
@tdeekens
Copy link
Contributor Author

tdeekens commented Mar 6, 2024

Thanks!

Just to better understand what this change does: is it about evaluation in the server side so the request time would potentially be shorter?

Not how I understood LaunchDarkly. There are some SDKs which have the legacy behaviour - to be non-breaking - that they send events to LaunchDarkly also for flags you don't requested.

The docs say:

Whether analytics events should be sent only when you call variation (true), or also when you call allFlags (false).
By default, this is false (events will be sent in both cases).

They recommend to only send analytic events for enabled flags as otherwise you run into cases in which false or non used flags send analytics data and then the flags are considered to be evaluated.

To be honest it's a recommendation they made. I will try out a local build to see what we get over the wire prior to merging this.

Copy link
Contributor

github-actions bot commented Mar 6, 2024

Deploy preview for application-kit-custom-views ready!

✅ Preview
https://application-kit-custom-views-rbl9jqlc4-commercetools.vercel.app
https://appkit-cv-sha-d47dcacbaf67d4496251ae3ce4b0c1a5f22b947a.commercetools.vercel.app
https://appkit-cv-pr-3426.commercetools.vercel.app

Built with commit e2a3691.
This pull request is being automatically deployed with vercel-action

@CarlosCortizasCT
Copy link
Contributor

Thanks!
Just to better understand what this change does: is it about evaluation in the server side so the request time would potentially be shorter?

Not how I understood LaunchDarkly. There are some SDKs which have the legacy behaviour - to be non-breaking - that they send events to LaunchDarkly also for flags you don't requested.

The docs say:

Whether analytics events should be sent only when you call variation (true), or also when you call allFlags (false).
By default, this is false (events will be sent in both cases).

They recommend to only send analytic events for enabled flags as otherwise you run into cases in which false or non used flags send analytics data and then the flags are considered to be evaluated.

To be honest it's a recommendation they made. I will try out a local build to see what we get over the wire prior to merging this.

Thanks for the explanation. I think I know understand better what we're trying to do. 👍

@tdeekens
Copy link
Contributor Author

tdeekens commented Mar 7, 2024

It doesn't seem to solve the issue but it should reduce a lot of networking we don't need/want anyway at this time.

@tdeekens tdeekens merged commit 6f0e6f6 into main Mar 7, 2024
20 checks passed
@tdeekens tdeekens deleted the td/ld-variation-events branch March 7, 2024 13:40
@ct-changesets ct-changesets bot mentioned this pull request Mar 7, 2024
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 this pull request may close these issues.

3 participants