Skip to content

feat: add funnelIds to remoteConfig and handle development defaults #2899

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ilasw
Copy link
Contributor

@ilasw ilasw commented Jul 4, 2025

No description provided.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Development Mode Funnel ID Retrieval Bug

In development mode (!isProd && !isTest), the resolveDynamicFunnelId function's logic for returning static funnel IDs is flawed. If GROWTHBOOK_API_CONFIG_CLIENT_KEY is set, remoteConfig.vars attempts to fetch from GrowthBook instead of providing the intended hardcoded development defaults. This leads to two issues:

  1. If GrowthBook doesn't return funnelIds, the function falls back to 'off' instead of the expected static values, contradicting the code comment.
  2. Accessing remoteConfig.vars before remoteConfig.init() completes can throw a "remote config not initialized" error, creating a race condition during application startup when GROWTHBOOK_API_CONFIG_CLIENT_KEY is present.

src/routes/boot.ts#L789-L794

});
if (!isProd && !isTest) {
// In development, we use a static value for the feature key
return remoteConfig?.vars?.funnelIds?.[featureKey] || 'off';
}
return gbClient.getFeatureValue(featureKey, 'off');

Fix in CursorFix in Web


Comment bugbot run to trigger another review on this PR
Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

1 participant