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(surveys): Process feature_flag_keys on Survey object #1548

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

Phanatic
Copy link
Contributor

Changes

As part of adaptive survey collection, we introduced a new feature flag that the surveys component should use to filter out surveys to be shown to people.
The common pattern has become :

  1. Add a flag to the API
  2. Add the same flag as a check to getActiveMatchingSurveys

Instead, this PR now uses the feature_flag_keys array to find the names of the feature flags to check in the survey component.
With this change, one can just add a new flag to the feature_flag_keys in the Surveys API in posthog.com and the survey component will automatically pick it up.

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

Copy link

vercel bot commented Nov 22, 2024

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

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 22, 2024 5:02pm

Copy link

Size Change: +2.81 kB (+0.09%)

Total Size: 3.14 MB

Filename Size Change
dist/array.full.es5.js 255 kB +312 B (+0.12%)
dist/array.full.js 358 kB +278 B (+0.08%)
dist/array.full.no-external.js 357 kB +278 B (+0.08%)
dist/array.js 172 kB +278 B (+0.16%)
dist/array.no-external.js 171 kB +278 B (+0.16%)
dist/main.js 173 kB +278 B (+0.16%)
dist/module.full.js 358 kB +278 B (+0.08%)
dist/module.full.no-external.js 357 kB +278 B (+0.08%)
dist/module.js 172 kB +278 B (+0.16%)
dist/module.no-external.js 171 kB +278 B (+0.16%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 206 kB
dist/dead-clicks-autocapture.js 14.3 kB
dist/exception-autocapture.js 9.36 kB
dist/external-scripts-loader.js 2.29 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 57.6 kB
dist/surveys.js 63.2 kB
dist/tracing-headers.js 1.75 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

Copy link
Contributor

@havenbarnes havenbarnes left a comment

Choose a reason for hiding this comment

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

Makes sense! 🚀

@Phanatic Phanatic added the bump minor Bump minor version when this PR gets merged label Nov 22, 2024
@Phanatic Phanatic merged commit 7122a63 into main Nov 22, 2024
17 checks passed
@Phanatic Phanatic deleted the adaptive-flags branch November 22, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants