Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(feature-flag): add the server-only mobile_sandbox_grant flag (#22623)

Tsuki8ce2e843ce5c
diff --git a/packages/app-config/src/featureFlags/schema.test.ts b/packages/app-config/src/featureFlags/schema.test.ts
index 9f21deafc7c..45433788493 100644
--- a/packages/app-config/src/featureFlags/schema.test.ts
+++ b/packages/app-config/src/featureFlags/schema.test.ts
@@ -290,6 +290,16 @@ describe('mapFeatureFlagsEnvToState', () => {
expect(state.enableMobileNewTierSales).toBeUndefined();
});
+ it('should keep the mobile sandbox grant off by default and out of the client state', () => {
+ expect(DEFAULT_FEATURE_FLAGS.mobile_sandbox_grant).toBe(false);
+ expect(FeatureFlagsSchema.parse({ mobile_sandbox_grant: ['tester-123'] })).toEqual({
+ mobile_sandbox_grant: ['tester-123'],
+ });
+ expect(
+ mapFeatureFlagsEnvToState({ mobile_sandbox_grant: ['tester-123'] }, 'tester-123'),
+ ).toEqual(mapFeatureFlagsEnvToState({}, 'tester-123'));
+ });
+
it('should keep topic previews off by default and enable them for listed users', () => {
expect(DEFAULT_FEATURE_FLAGS.topic_preview).toBe(false);
expect(mapFeatureFlagsEnvToState(DEFAULT_FEATURE_FLAGS, 'user-1').enableTopicPreview).toBe(
diff --git a/packages/app-config/src/featureFlags/schema.ts b/packages/app-config/src/featureFlags/schema.ts
index 0c346f2cfee..b238d976418 100644
--- a/packages/app-config/src/featureFlags/schema.ts
+++ b/packages/app-config/src/featureFlags/schema.ts
@@ -123,6 +123,7 @@ export const FeatureFlagsSchema = z.object({
onboarding_v2: FeatureFlagValue.optional(),
new_tier_plans: FeatureFlagValue.optional(),
mobile_new_tier_sales: FeatureFlagValue.optional(),
+ mobile_sandbox_grant: FeatureFlagValue.optional(),
storage_overage: FeatureFlagValue.optional(),
workspace: FeatureFlagValue.optional(),
@@ -243,6 +244,9 @@ export const DEFAULT_FEATURE_FLAGS: IFeatureFlags = {
// publishes a whitelist (array of user IDs) or flips it to true.
new_tier_plans: false,
mobile_new_tier_sales: false,
+ // Server-only: Cloud lets a store sandbox purchase grant entitlement only for user IDs listed
+ // explicitly; `true` and percentage rollout count as off, and it never reaches the client state.
+ mobile_sandbox_grant: false,
storage_overage: true,
workspace: isDev,